*,:after,:before{box-sizing:border-box;margin:0;padding:0}body,html{height:100%;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif}body{background:linear-gradient(135deg,#1a0000,#3d0000 50%,#1a0000)}.page-wrapper,body{min-height:100vh;display:flex;align-items:center;justify-content:center}.page-wrapper{flex-direction:column;padding:20px;gap:24px}.calculator-container{background:linear-gradient(145deg,#b71c1c,#7f0000);border-radius:20px;padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.6),0 0 0 1px hsla(0,100%,70%,.15),inset 0 1px 0 hsla(0,0%,100%,.1);width:100%;max-width:360px}.calculator-title{text-align:center;color:hsla(0,100%,93%,.8);font-size:13px;font-weight:600;letter-spacing:3px;text-transform:uppercase;margin-bottom:16px}.display{background:linear-gradient(145deg,#4a0000,#2d0000);border-radius:12px;padding:16px 20px;margin-bottom:20px;min-height:90px;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;border:1px solid hsla(0,100%,70%,.2);box-shadow:inset 0 4px 12px rgba(0,0,0,.4);overflow:hidden}.display-expression{color:hsla(0,100%,85%,.7);font-size:14px;min-height:20px;margin-bottom:4px}.display-expression,.display-value{word-break:break-all;text-align:right;width:100%}.display-value{color:#fff;font-size:36px;font-weight:300;line-height:1.1;text-shadow:0 0 20px hsla(0,100%,79%,.4)}.display-value.error{color:#ff8a80;font-size:28px}.buttons-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-gap:10px;gap:10px}.btn{border:none;border-radius:10px;font-size:18px;font-weight:600;cursor:pointer;height:64px;display:flex;align-items:center;justify-content:center;transition:all .12s ease;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.btn:after{content:"";position:absolute;inset:0;background:hsla(0,0%,100%,0);transition:background .12s ease}.btn:hover:after{background:hsla(0,0%,100%,.08)}.btn:active{transform:scale(.94);box-shadow:none!important}.btn-number{background:linear-gradient(145deg,#c62828,#8b0000);color:#fff;box-shadow:0 4px 10px rgba(0,0,0,.3),inset 0 1px 0 hsla(0,0%,100%,.12);border:1px solid hsla(0,100%,70%,.15)}.btn-number:hover{background:linear-gradient(145deg,#d32f2f,#9a0000)}.btn-operator{background:linear-gradient(145deg,#e53935,#b71c1c);color:#fff3e0;box-shadow:0 4px 10px rgba(0,0,0,.3),inset 0 1px 0 hsla(0,0%,100%,.15);border:1px solid rgba(255,150,100,.2);font-size:22px}.btn-operator:hover{background:linear-gradient(145deg,#ef5350,#c62828)}.btn-clear{background:linear-gradient(145deg,#ff5252,#d50000);color:#fff;box-shadow:0 4px 10px rgba(0,0,0,.3),inset 0 1px 0 hsla(0,0%,100%,.2);border:1px solid hsla(0,100%,89%,.2);font-size:16px;font-weight:700;letter-spacing:1px}.btn-clear:hover{background:linear-gradient(145deg,#ff6e6e,#e60000)}.btn-delete{background:linear-gradient(145deg,#c62828,#8b0000);color:#ffcdd2;box-shadow:0 4px 10px rgba(0,0,0,.3),inset 0 1px 0 hsla(0,0%,100%,.12);border:1px solid hsla(0,100%,70%,.15);font-size:20px}.btn-delete:hover{background:linear-gradient(145deg,#d32f2f,#9a0000)}.btn-equals{background:linear-gradient(145deg,#ff1744,#b71c1c);color:#fff;grid-column:span 2;box-shadow:0 6px 16px rgba(255,23,68,.4),inset 0 1px 0 hsla(0,0%,100%,.2);border:1px solid hsla(0,100%,89%,.25);font-size:24px;font-weight:700;letter-spacing:1px}.btn-equals:hover{background:linear-gradient(145deg,#ff4569,#c62828);box-shadow:0 8px 20px rgba(255,23,68,.5),inset 0 1px 0 hsla(0,0%,100%,.2)}.btn-zero{grid-column:span 1}.history-container{background:linear-gradient(145deg,rgba(183,28,28,.4),rgba(127,0,0,.4));border-radius:16px;padding:16px 20px;width:100%;max-width:360px;border:1px solid hsla(0,100%,70%,.15);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.history-title{color:hsla(0,100%,89%,.8);font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between}.history-clear-btn{background:none;border:1px solid hsla(0,100%,70%,.3);color:hsla(0,100%,85%,.7);font-size:10px;padding:3px 8px;border-radius:4px;cursor:pointer;transition:all .2s;letter-spacing:1px}.history-clear-btn:hover{background:hsla(0,100%,70%,.15);color:#ffcdd2}.history-list{display:flex;flex-direction:column;gap:6px;max-height:160px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:hsla(0,100%,70%,.3) transparent}.history-list::-webkit-scrollbar{width:4px}.history-list::-webkit-scrollbar-track{background:transparent}.history-list::-webkit-scrollbar-thumb{background:hsla(0,100%,70%,.3);border-radius:2px}.history-item{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:rgba(0,0,0,.2);border-radius:8px;border:1px solid hsla(0,100%,70%,.1);cursor:pointer;transition:background .15s}.history-item:hover{background:hsla(0,100%,70%,.1)}.history-expression{color:hsla(0,100%,85%,.7);font-size:12px;flex:1 1;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.history-result{color:#ffcdd2;font-size:14px;font-weight:600;margin-left:8px;white-space:nowrap}.history-empty{color:hsla(0,100%,85%,.4);padding:12px 0;font-style:italic}.history-empty,.history-loading{font-size:12px;text-align:center}.history-loading{color:hsla(0,100%,85%,.5);padding:8px 0}