* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial;

    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

/* Calculator */
.calculator {
    background: #121212;
    padding: 20px;
    border-radius: 20px;
    width: 320px;
    max-width: 95%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Name */
.title {
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;

    background: linear-gradient(135deg, #00f260, #0575e6, #fc466b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mirror Display */
#display {
    width: 100%;
    height: 70px;
    font-size: 26px;
    border-radius: 12px;
    border: none;
    margin-bottom: 15px;
    padding: 10px;
    text-align: right;

    background: rgba(255,255,255,0.05);
    color: #00ffe0;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: inset 3px 3px 10px rgba(255,255,255,0.1),
                inset -3px -3px 10px rgba(0,0,0,0.8);

    font-family: "Courier New", monospace;
}

/* Buttons Grid */
.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Buttons */
button {
    height: 65px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    font-weight: bold;

    box-shadow: 6px 6px 12px #000,
                -2px -2px 6px #2a2a2a;

    transition: 0.2s;
}

button:active {
    transform: scale(0.92);
}

/* Colors */
.num { background: linear-gradient(135deg, #667eea, #764ba2); }
.op { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.equal { background: linear-gradient(135deg, #00f260, #0575e6); }
.clear { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.del { background: linear-gradient(135deg, #f7971e, #ffd200); color:#000; }
.history-btn { background: linear-gradient(135deg, #fc466b, #3f5efb); }

.zero {
    grid-column: span 2;
}

/* History */
.history {
    margin-top: 15px;
    background: #0d0d0d;
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

/* Responsive */
@media (max-width: 500px) {
    .calculator {
        width: 90%;
    }

    #display {
        height: 60px;
        font-size: 22px;
    }

    button {
        height: 55px;
        font-size: 16px;
    }
}