body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #e0f7fa; /* Light blue background */
    overflow: hidden;
}

#game-container {
    width: 1200px;
    height: 700px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #81c784; /* Green header */
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#reset-button {
    background-color: #ffb74d; /* Orange */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#reset-button:hover {
    background-color: #ffa726;
}

#conveyor-area {
    position: relative;
    width: 100%;
    height: 250px; /* Height for conveyor and items */
    background-color: #bbdefb; /* Light blue */
    overflow: hidden;
    border-bottom: 5px solid #66bb6a; /* Green border */
    display: flex;
    align-items: center; /* Vertically center items on conveyor */
}

#conveyor-belt {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#item-spawn-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.trash-item {
    position: absolute;
    width: 80px;
    height: 80px;
    cursor: grab;
    transition: transform 0.1s ease-out; /* Smooth hover effect */
    z-index: 7; /* Items above conveyor */
    pointer-events: auto; /* Ensure items are draggable */
}

.trash-item:hover {
    transform: scale(1.05);
}

.trash-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#bottom-area {
    display: flex;
    flex-grow: 1;
    padding: 20px;
    background-color: #c8e6c9; /* Lighter green */
    position: relative;
    gap: 20px;
}

#professor-bubbles-container {
    position: relative;
    width: 200px; /* Fixed width for Professor */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#professor-bubbles-char {
    width: 150px;
    height: 150px;
    object-fit: contain;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 8;
    transition: transform 0.2s ease-out; /* Smooth scale transition */
}

#professor-bubbles-char.cheer {
    animation: bubbleCheer 0.5s ease-in-out;
}

@keyframes bubbleCheer {
    0% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(-10px) scale(1.05); }
    50% { transform: translateX(-50%) translateY(0) scale(1); }
    75% { transform: translateX(-50%) translateY(-5px) scale(1.02); }
    100% { transform: translateX(-50%) translateY(0) scale(1); }
}

#professor-speech-bubble {
    position: absolute;
    top: 20px;
    left: 100%; /* To the right of Professor */
    background-color: #fff;
    border: 2px solid #558b2f; /* Darker green border */
    border-radius: 20px;
    padding: 10px 15px;
    width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
    color: #333;
    text-align: center;
    z-index: 9;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#professor-speech-bubble::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-right-color: #fff;
    border-left: 0;
    top: 50%;
    left: -15px; /* Points to the professor */
    transform: translateY(-50%);
}

#professor-speech-bubble::after { /* For the border of the arrow */
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 17px solid transparent;
    border-right-color: #558b2f;
    border-left: 0;
    top: 50%;
    left: -19px;
    transform: translateY(-50%);
    z-index: -1;
}


#bin-container {
    flex-grow: 1;
    display: flex;
    justify-content: space-around;
    align-items: flex-end; /* Align bins to the bottom */
    gap: 15px;
    margin-right: 180px; /* Adjust for Professor's width */
}

.bin-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4; /* Initially hidden/disabled */
    transition: opacity 0.3s ease;
}

.bin-wrapper.active {
    opacity: 1;
}

.bin {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    color: white;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid transparent; /* For drop highlight */
}

.bin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.bin span {
    margin-top: -30px; /* Adjust text position over bin image if needed */
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Bin specific colors (if not part of image) */
#plastic-bin { background-color: #64b5f6; /* Blue */ }
#glass-bin { background-color: #ffee58; /* Yellow */ }
#paper-bin { background-color: #ef5350; /* Red */ }
#organic-bin { background-color: #8d6e63; /* Brown */ }

.bin.drag-over {
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.hidden {
    display: none !important;
}

/* Overlay for level facts */
#overlay {
    position: absolute;
    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;
}

#level-fact-modal {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
}

#modal-title {
    color: #4caf50; /* Green */
    font-size: 2.5em;
    margin-bottom: 20px;
}

#modal-fact {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

#modal-next-level {
    background-color: #4caf50; /* Green */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#modal-next-level:hover {
    background-color: #66bb6a;
}

