body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    overflow: hidden;
}

#game-container {
    width: 800px;
    height: 600px;
    border: 2px solid #333;
    background-color: #d3e0e8;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

#ui-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: #333;
    color: white;
    font-size: 20px;
}

#game-area {
    width: 100%;
    height: calc(100% - 45px); /* Adjust based on ui-bar height */
    position: relative;
    display: flex; /* Use flexbox for vertical alignment */
    flex-direction: column;
    justify-content: space-around; /* Distribute belts evenly */
    align-items: center;
}

.conveyor-belt {
    width: 90%; /* Make belts slightly narrower to fit multiple */
    height: 120px; /* Slightly smaller height for multiple belts */
    border-top: 5px solid;
    border-bottom: 5px solid;
    position: relative; /* Changed from absolute */
    margin: 10px 0; /* Add some vertical spacing */
}

/* Production Line Styles */
.conveyor-belt.plastic-cup {
    background-color: #6a8c6a;
    border-color: #4d664d;
    background-image: repeating-linear-gradient(
        -45deg,
        #7ca37c,
        #7ca37c 20px,
        #6a8c6a 20px,
        #6a8c6a 40px
    );
}

.conveyor-belt.paper-cup {
    background-color: #a0a0a0; /* Light grey for paper */
    border-color: #757575;
    background-image: repeating-linear-gradient(
        -45deg,
        #b5b5b5,
        #b5b5b5 20px,
        #a0a0a0 20px,
        #a0a0a0 40px
    );
}

.conveyor-belt.glassware {
    background-color: #5a7d8c;
    border-color: #425c66;
    background-image: repeating-linear-gradient(
        -45deg,
        #6c94a3,
        #6c94a3 20px,
        #5a7d8c 20px,
        #5a7d8c 40px
    );
}

.conveyor-belt.plastic-cup {
    background-color: #6a8c6a;
    border-color: #4d664d;
    background-image: repeating-linear-gradient(
        -45deg,
        #7ca37c,
        #7ca37c 20px,
        #6a8c6a 20px,
        #6a8c6a 40px
    );
}

.conveyor-belt.paper-cup {
    background-color: #a0a0a0; /* Light grey for paper */
    border-color: #757575;
    background-image: repeating-linear-gradient(
        -45deg,
        #b5b5b5,
        #b5b5b5 20px,
        #a0a0a0 20px,
        #a0a0a0 40px
    );
}

.cup {
    width: 100px; /* Adjust size as needed */
    height: 100px; /* Adjust size as needed */
    background-color: transparent; /* No background color */
    border: none; /* No border */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    /* Remove overflow: hidden to see overlays if they are larger */
}

.cup img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image aspect ratio is maintained */
    pointer-events: none; /* Clicks should register on the parent div */
}

.cup .defect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Ensure defect is on top of the cup image */
    pointer-events: none; /* Allow clicks to pass through to the underlying cup */
}

/* Remove all old CSS-based drawing styles for cup types and defects */
/* e.g., .cup.mug, .cup.defective.crack::after, etc. */

.cup.golden-cup img {
    /* Optional: Add a glow effect for the golden cup image */
    filter: drop-shadow(0 0 10px gold);
}

#bonus-time-indicator,
#speed-up-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 24px;
    font-weight: bold;
    z-index: 1000;
    animation: pulse 1s infinite alternate;
}

#speed-up-indicator {
    background-color: #FF5722; /* Orange-red for speed up */
    top: 60px; /* Position below bonus indicator */
}

@keyframes pulse {
    from { transform: translateX(-50%) scale(1); opacity: 1; }
    to { transform: translateX(-50%) scale(1.05); opacity: 0.9; }
}

.feedback-popup {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    pointer-events: none; /* Allow clicks to pass through */
    animation: feedback-fade-out 1s forwards;
    z-index: 1001;
}

@keyframes feedback-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-50px); }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overlay h1 { font-size: 50px; }
.overlay h2 { font-size: 40px; }
.overlay button {
    padding: 15px 30px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background-color: #4CAF50;
    color: white;
}

.selection-group {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.selection-group label {
    margin-right: 10px;
    font-size: 18px;
}

.selection-group input[type="checkbox"] {
    margin-right: 5px;
}