body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: #87CEEB; /* Sky blue */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: #333;
    background-image: url('background.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

#game-container {
    width: 90vw;
    max-width: 1000px;
    height: 90vh;
    max-height: 700px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-rows: 2fr 4fr 1.5fr; /* Bubbles, Plant, Controls */
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

#professor-bubbles {
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    position: relative;
    z-index: 10;
}

#professor-bubbles-img {
    width: 120px;
    height: auto;
    position: absolute;
    left: 5%;
    bottom: 0;
    transform: translateY(20%); /* Overlap with dialogue */
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.2));
    transition: transform 0.2s ease-out;
}

#professor-bubbles-img.talking {
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(20%); }
    to { transform: translateY(15%); }
}

#dialogue-box {
    background-color: #fff;
    border: 3px solid #6c5ce7; /* Purple border */
    border-radius: 25px;
    padding: 15px 25px;
    margin-left: 100px; /* Space for Bubbles */
    font-family: 'Fredoka One', cursive;
    font-size: 1.2em;
    color: #6c5ce7;
    text-align: center;
    max-width: 60%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

#dialogue-box::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 20px solid #6c5ce7;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
}
#dialogue-box::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 18px solid #fff;
    left: -17px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}


#plant-area {
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    perspective: 1000px; /* For 3D effects if desired */
}

#plant-image {
    max-width: 80%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 1s ease-out, opacity 1s ease-out, filter 0.5s ease-in-out;
    filter: drop-shadow(5px 5px 10px rgba(0,0,0,0.3));
    transform-origin: bottom center;
}

#plant-image.growing {
    animation: growPulse 1s forwards ease-out;
}

@keyframes growPulse {
    0% { transform: scale(0.8) translateY(20px); opacity: 0.5; }
    50% { transform: scale(1.05) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

#plant-image.wilting {
    filter: grayscale(80%) brightness(80%) sepia(20%);
    transform: rotateZ(-5deg) translateY(5px);
}

#controls {
    grid-row: 3;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-top: 2px solid #ddd;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.control-button {
    background-color: #a29bfe; /* Light purple */
    border: none;
    border-radius: 15px;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    user-select: none; /* Prevent text selection */
}

.control-button:hover {
    transform: translateY(-5px);
    background-color: #6c5ce7; /* Darker purple */
}

.control-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-button img {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3));
}

/* Win Screen */
#win-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

#win-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.win-content {
    background-color: #fff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    animation: popIn 0.5s forwards ease-out;
}

@keyframes popIn {
    to { transform: scale(1); }
}

#win-message {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5em;
    color: #28a745; /* Green for success */
    margin-bottom: 20px;
    animation: textColorPulse 2s infinite alternate;
}

@keyframes textColorPulse {
    from { color: #28a745; }
    to { color: #5cb85c; }
}

#sticker-image {
    width: 150px;
    height: auto;
    margin-bottom: 30px;
    animation: floatAndRotate 3s infinite ease-in-out;
}

@keyframes floatAndRotate {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

#play-again-button {
    background-color: #ffc107; /* Yellow */
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, transform 0.2s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#play-again-button:hover {
    background-color: #e0a800; /* Darker yellow */
    transform: translateY(-3px);
}

#play-again-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

