body {
    font-family: 'Kalam', cursive;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    /* OVERFLOW: HIDDEN has been REMOVED. This is the most important fix. */
}

.back-button-container {
    position: fixed; /* Keeps it in place even when scrolling */
    bottom: 30px;    /* 30px from the bottom of the screen */
    left: 0;
    width: 100%;
    text-align: center; /* Centers the button inside the container */
    z-index: 100; /* Ensures it stays on top of other elements */
}

/* Updated styles for your back button */
.back-link {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #fcb6c7, #f88da6); /* Matching the other buttons' color */
    color: white;
    text-decoration: none;
    border-radius: 25px; /* Matching border-radius */
    
    /* CHANGE: Applying the same font as the other buttons */
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1em;
    
    transition: background-color 0.3s, transform 0.2s;
}

.back-link:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #f88da6, #fcb6c7);
}

/* --- Animated Background --- */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* This overflow is fine here, on the container */
    z-index: -1; 
    /* This allows clicks to pass through the container to the hearts inside */
    pointer-events: none; 
    background: linear-gradient(135deg, #fde2e4, #f8cdda);
}

.hearts-container::before,
.hearts-container::after {
    content: '💖';
    position: absolute;
    font-size: 30vw;
    opacity: 0.1;
    filter: blur(5px); 
    z-index: -2; /* Keep these giant hearts in the very back */
}

/* --- Polaroid Styles --- */
.polaroid {
    background: #fff;
    padding: 10px 10px 25px 10px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
    width: 170px;
    transition: transform 0.2s ease-in-out;
}

.polaroid .caption {
    font-size: 1.1em;
    text-align: center;
    margin: 15px 0 0 0;
    color: #333;
}

.polaroid img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.side-polaroid {
    position: absolute;
    z-index: 2; 
}

.side-polaroid:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 10;
}

#polaroid-left {
    top: 20vh;
    left: 14vw;
    transform: rotate(-12deg);
}

#polaroid-right {
    top: 25vh;
    right: 15vw;
    transform: rotate(10deg);
}


/* --- Main Game Container --- */
#game-container {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 5; /* Keep it above the hearts */
}

#game-container h1, #game-container h2 {
    font-family: 'Georgia', serif;
    color: #e91e63;
}

#start-screen p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
}

.hidden {
    display: none;
}

@media (max-width: 1024px) {
    .side-polaroid {
        display: none;
    }
}

/* --- CORRECTED HEART AND PARTICLE STYLES --- */
.heart {
    position: absolute;
    top: -10vh;
    font-size: 24px;
    opacity: 0;
    animation: fall 10s infinite linear;
    /* This is CRITICAL: It allows individual hearts to be clicked */
    pointer-events: auto; 
    cursor: pointer;
    user-select: none;
    z-index: 1; /* Puts hearts above the background but below content */
}

@keyframes fall {
    0% { top: -10vh; opacity: 1; transform: rotate(0deg); }
    100% { top: 110vh; opacity: 1; transform: rotate(720deg); }
}

.particle {
    position: fixed;
    font-size: 14px;
    animation: explode 1s forwards;
    pointer-events: none;
    z-index: 999; /* Particles explode on top of everything */
    user-select: none;
}

@keyframes explode {
    0% { opacity: 1; transform: translate(0,0) rotate(0); }
    100% { opacity: 0; transform: translate(var(--x),var(--y)) rotate(720deg); }
}

/* --- Unchanged Button/Input/Gallery Styles --- */
button{background-color:#e91e63;color:#fff;border:none;padding:12px 25px;border-radius:25px;font-size:1em;cursor:pointer;transition:background-color .3s ease;margin-top:15px}button:hover{background-color:#c2185b}#question-container{margin-top:20px}#answer-input{width:calc(100% - 22px);padding:10px;margin-top:10px;border:1px solid #ddd;border-radius:5px}#feedback{margin-top:10px;font-style:italic;color:#d32f2f}#final-message .message-box{background-color:#fce4ec;border:1px dashed #e91e63;padding:20px;margin-top:20px;border-radius:10px;text-align:left}.gallery{margin-top:20px;display:flex;flex-wrap:wrap;justify-content:center;gap:20px}.gallery-item{background-color:#fafafa;border:1px solid #eee;border-radius:8px;overflow:hidden;width:150px}.gallery-item img{width:100%;height:150px;object-fit:cover;display:block}.gallery-item .caption{padding:10px;font-size:.9em;font-style:italic;color:#555;margin:0}.final-words{margin-top:30px;font-size:1.3em;color:#e91e63}

/* --- Button, Input, and Gallery Styles --- */

/* Updated button styles */
button {
    background-color: #e91e63;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    /* CHANGE: Font family and weight */
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; /* Makes the button text bolder */
    font-size: 1em;
    cursor: pointer;
    transition: background-color .3s ease;
    margin-top: 15px;
}

button:hover {
    background-color: #c2185b;
}

#question-container {
    margin-top: 20px;
}

/* Updated input field styles */
#answer-input {
    width: calc(100% - 22px);
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    /* CHANGE: Set the font for the text you type */
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
}

/* NEW: Style the placeholder text specifically */
#answer-input::placeholder {
    font-family: 'Montserrat', sans-serif;
    color: #999; /* A slightly lighter color for the placeholder */
}

#feedback {
    margin-top: 10px;
    font-style: italic;
    color: #d32f2f;
}

#final-message .message-box {
    background-color: #fce4ec;
    border: 1px dashed #e91e63;
    padding: 20px;
    margin-top: 20px;
    border-radius: 10px;
    text-align: left;
}

.gallery {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.gallery-item {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    width: 150px;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-item .caption {
    padding: 10px;
    font-size: .9em;
    font-style: italic;
    color: #555;
    margin: 0;
}

.final-words {
    margin-top: 30px;
    font-size: 1.3em;
    color: #e91e63;
}
