body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: sans-serif;
}

.calculator {
    background-color: #3a4452;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 320px;
    /* Фиксированная ширина */
}

#display {
    width: 100%;
    height: 60px;
    font-size: 2em;
    text-align: right;
    margin-bottom: 15px;
    padding: 10px;
    box-sizing: border-box;
    /* Учитываем padding в ширине */
    border: none;
    background-color: #a1c0a1;
    /* Цвет дисплея */
    border-radius: 8px;
    color: #2b3a42;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 колонки равной ширины */
    gap: 10px;
    /* Промежутки между кнопками */
}

button {
    padding: 15px;
    font-size: 1.3em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #e0e0e0;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover {
    background-color: #d5d5d5;
}

button:active {
    transform: scale(0.95);
    /* Эффект нажатия */
    background-color: #cccccc;
}

.operator {
    background-color: #ff9f0a;
    /* Оранжевый для операторов */
    color: white;
}

.operator:hover {
    background-color: #f08e0a;
}

.operator:active {
    background-color: #d97f09;
}


.clear {
    background-color: #f56565;
    /* Красный для C */
    color: white;
}

.clear:hover {
    background-color: #e53e3e;
}

.clear:active {
    background-color: #c53030;
}

.equals {
    background-color: #4caf50;
    /* Зеленый для = */
    color: white;
    grid-column: span 1;
    /* Растягиваем кнопку '=' по умолчанию на 1 колонку */
    /* Если нужно растянуть на 2 колонки, измените span на 2 и удалите одну кнопку или добавьте пустую*/
    /* grid-column: span 2;  */
}

.equals:hover {
    background-color: #43a047;
}

.equals:active {
    background-color: #388e3c;
}

.zero {
    grid-column: span 2;
    /* Кнопка 0 занимает 2 колонки */
}