:root{
  --bg:#0b1220;
  --card:#0f172a;
  --accent:#7c3aed;
  --muted:#94a3b8;
  --glass: rgba(255,255,255,0.03);
  --glass-2: rgba(255,255,255,0.02);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#071022 0%, #081427 100%);
  color:#e6eef8;
  -webkit-font-smoothing:antialiased;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.page{width:100%;max-width:420px}
.top{text-align:center;margin-bottom:12px}
h1{margin:6px 0;font-size:20px;letter-spacing:0.3px}
.tagline{color:var(--muted);margin:0;font-size:13px}

.calculator{
  background:linear-gradient(180deg,var(--card), #071227);
  border-radius:18px;
  padding:14px;
  box-shadow:0 8px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(6px);
}
.display{
  height:76px;
  border-radius:12px;
  background:var(--glass);
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  padding:12px;
  font-size:28px;
  font-weight:600;
  color:#f8fafc;
  margin-bottom:12px;
  box-shadow:0 6px 20px rgba(2,6,23,0.5);
  transition: box-shadow 250ms ease, transform 120ms ease;
}
.display.glow{ box-shadow: 0 8px 30px rgba(124,58,237,0.18); transform: translateY(-2px); }

.keys{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.btn{
  background:var(--glass-2);
  border:0;
  padding:16px;
  border-radius:12px;
  font-size:18px;
  font-weight:600;
  color:var(--muted);
  box-shadow:0 6px 18px rgba(2,6,23,0.5);
  transition: transform 150ms cubic-bezier(.2,.9,.2,1), box-shadow 150ms;
  touch-action: manipulation;
}
.btn:active{ transform: translateY(4px) scale(.995); }
.btn:hover{ transform: translateY(-4px); color:#fff; box-shadow:0 12px 30px rgba(2,6,23,0.6); }

.btn.op{ background: linear-gradient(180deg, rgba(124,58,237,0.15), rgba(124,58,237,0.06)); color:#fff; }
.btn.util{ background: transparent; color:var(--muted); font-weight:700; }
.btn.result{ background:linear-gradient(90deg,var(--accent), #5b21b6); color:white; grid-column:4; }
.btn.wide{ grid-column:1 / span 2; }

.foot{ text-align:center;color:var(--muted); margin-top:12px; font-size:12px }

@media (max-width:420px){
  .display{height:68px;font-size:24px}
  .btn{padding:14px;font-size:17px}
}
