.calculator {
    background: #FFF;
    border-radius: 4px;
    padding: 5px;
    border: solid 2px #333;
}

.display-container {
    margin-bottom: 10px;
}

#history {
    width: 100%;
    height: 30px;
    border: none;
    background: #ddd;
    color: #333;
    text-align: right;
    padding: 5px 20px;
    font-size: .8em;
    border-radius: 0px;
    margin-bottom: 1px;
}

#display {
    width: 100%;
    height: 45px;
    border: none;
    background: #ddd;
    color: #000;
    text-align: right;
    padding: 5px 20px;
    font-size: 1.4em;
    border-radius: 0px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

button {
    padding: 5px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

button:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

button:active {
    transform: scale(0.95);
}

.number {
  background: #333;
  color: white;
}

.operator {
    color: #000;
}

.memory {
    color: #000;
}

.function {
  color: black;
  font-size: 0.9em;
}

.equals {
    background: #2196F3;
    color: white;
    font-weight: bold;
}

.clear {
    background: #f44336;
    color: white;
    font-weight: bold;
}

@media (max-width: 500px) {
    .calculator {
        padding: 10px;
    }

    button {
        padding: 5px;
        font-size: 0.7em;
    }

    #display {
        font-size: 1.2em;
        height: 40px;
    }
}