* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #141416, #000);
    display: flex;
    justify-content: center;
    align-items: center;
}


.app {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}


.calculator {
    width: 340px;
    padding: 22px;
    border-radius: 32px;
    background: linear-gradient(180deg, #1c1c20, #141416);
    box-shadow:
        0 25px 50px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(255,255,255,0.04);
}


.display {
    background: #050505;
    color: #f5f5f7;
    padding: 22px 14px;
    border-radius: 22px;
    text-align: right;
    font-size: 3rem;
    margin-bottom: 18px;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.9);
}


.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}


.calc-btn {
    height: 62px;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    background: #2c2c30;
    color: #f2f2f7;
    transition: all 0.15s ease;
    box-shadow:
        0 6px 12px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05);
}


.func {
    background: #3a3a3f;
    font-size: 1rem;
    color: #d1d1d6;
}


.operator {
    background: linear-gradient(180deg, #ffb020, #ff9f0a);
    color: #fff;
    font-weight: bold;
}


.clear {
    background: linear-gradient(180deg, #ff5a4f, #ff453a);
    font-weight: bold;
}


.equal {
    background: linear-gradient(180deg, #34e36a, #32d74b);
    grid-column: span 2;
    border-radius: 35px;
    font-weight: bold;
}


.calc-btn:active {
    transform: scale(0.94);
    filter: brightness(1.15);
}


.history-toggle {
    background: #1f1f22;
    color: #f2f2f7;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.7);
}

.history-toggle:hover {
    background: #2a2a2e;
}


.history-panel {
    width: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #1f1f22, #18181b);
    border-radius: 22px;
    padding: 0;
    color: #f2f2f7;
    max-height: 420px;
    transition: 0.3s;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.history-panel.active {
    width: 240px;
    padding: 16px;
}


.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2c2c30;
    padding: 6px 0;
    font-size: 0.9rem;
}


.delete-history {
    background: #ff453a;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}