:root {
    --scale-width: 500px;
    --scale-height: 200px;
}

body {
    font-family: 'Georgia', serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f7f7f7;
    color: #333;
}

#game-container {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

h1 {
    color: #4CAF50;
    margin-bottom: 20px;
}

#status-area {
    display: flex;
    justify-content: space-around;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 20px;
}

/* --- Scale Platform --- */
#scale-platform {
    width: var(--scale-width);
    height: var(--scale-height);
    margin: 30px auto 40px;
    position: relative;
}

#fulcrum {
    width: 10px;
    height: 30px;
    background-color: #333;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

#beam {
    width: 100%;
    height: 10px;
    background-color: #a0522d; /* Brown wood */
    position: absolute;
    top: 50%;
    /* The transform-origin is key for rotation around the fulcrum */
    transform-origin: center center; 
    transition: transform 0.8s ease-out; /* Smooth tilt animation */
    z-index: 10;
    display: flex;
    justify-content: space-between;
}

/* --- Drop Zones (Pans) --- */
.pan {
    width: 35%; /* Width of the pan surface */
    height: 100px;
    /* Simulate distance from fulcrum */
    margin-top: 50px; 
    background-color: rgba(200, 200, 200, 0.5); 
    border: 2px dashed #666;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap; /* Allows multiple objects */
    align-content: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 5px;
    box-sizing: border-box;
    position: relative; /* For object placement */
    z-index: 15;
}

#left-pan { margin-left: -50px; } /* Pull left pan closer to edge */
#right-pan { margin-right: -50px; } /* Pull right pan closer to edge */

/* --- Inventory and Objects --- */
#inventory {
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.object {
    padding: 8px 15px;
    background-color: #f1c40f; /* Yellow object */
    color: #333;
    border: 2px solid #f39c12;
    border-radius: 4px;
    cursor: grab;
    font-weight: bold;
    user-select: none;
    transition: opacity 0.2s;
}

.object.dragging {
    opacity: 0.5;
}

.object.used {
    cursor: default;
    opacity: 0.3;
}

/* --- Controls and Feedback --- */
#feedback-message {
    min-height: 1.5em;
    margin-bottom: 20px;
    font-weight: 500;
}

#controls button {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#check-button {
    background-color: #4CAF50; /* Green check */
    color: white;
}

#check-button:hover:not(:disabled) {
    background-color: #388e3c;
}

#reset-button {
    background-color: #3498db; /* Blue reset */
    color: white;
}

#reset-button:hover {
    background-color: #2980b9;
}