:root {
    --bg-color: #f0f2f5;
    --tower-bg: #ffffff;
    --green-box: #a7d7c5;
    --yellow-box: #f9eac3;
    --red-box: #f5c3c2;
    --number-box: #c1d5e0;
    --border-color: #cccccc;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#game-container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    color: #4a4e69;
}

#main-content {
    display: grid;
    grid-template-columns: 1fr 3fr 1.5fr;
    gap: 20px;
    align-items: flex-start;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#controls button {
    font-size: 2rem;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: var(--tower-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

#controls button:hover {
    transform: scale(1.1);
}

#tower-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    padding: 20px;
    background-color: var(--tower-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: 400px;
    overflow-y: auto;
}

.floor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.box {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.operator, .equals {
    font-size: 2rem;
    font-weight: bold;
    width: 40px; /* NEW: Give a fixed width */
    display: flex; /* NEW: Enable flexbox for centering */
    justify-content: center; /* NEW: Center horizontally */
    align-items: center; /* NEW: Center vertically */
}

.input-box.green {
    background-color: var(--green-box);
    cursor: pointer;
}

.result-box.yellow {
    background-color: var(--yellow-box);
    border-style: solid;
}

.summit-box.red {
    background-color: var(--red-box);
    border-style: solid;
}

.input-box.drag-over {
    border-color: #333;
    transform: scale(1.05);
}

#number-bank-container {
    padding: 15px;
    background: var(--tower-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

#number-bank {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.number-item {
    background-color: var(--number-box);
    cursor: grab;
    user-select: none;
    border-style: solid;
}

.number-item.used {
    opacity: 0.4;
    cursor: not-allowed;
}

.invalid-result {
    color: #d9534f !important;
}

.equals.incorrect {
    color: #d9534f;
    transform: scale(1.2);
    font-weight: bold;
}

/* Modal Styles */
.hidden {
    display: none !important;
}

#modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#win-modal {
    background-color: white;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
}

#win-modal h2 {
    margin-top: 0;
    color: #4a4e69;
}

#next-level-btn {
    background-color: #a7d7c5;
    color: #333;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

#next-level-btn:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Add this to your style.css file */
.highlighted {
    box-shadow: 0 0 0 4px #4a90e2; /* A blue glow */
    transform: scale(1.05);
}