:root{
  --bg: #0f1220;
  --panel: #171a2b;
  --accent: #7c5cff;
  --accent-2: #21d4fd;
  --text: #e9e9ef;
  --muted: #a8adbd;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 10% -20%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(800px 500px at 110% 120%, rgba(33,212,253,.18), transparent 50%),
    var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 420px;
}

.calculator {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.display {
  width: 100%;
  height: 84px;
  padding: 16px 18px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.2));
  color: var(--text);
  font-size: 34px;
  line-height: 1.2;
  text-align: right;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.05);
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.key {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 16px 0;
  font-size: 20px;
  color: var(--text);
  background: linear-gradient(180deg, #1b1f33, #14182a);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 14px rgba(0,0,0,.28);
  transition: transform .05s ease, filter .15s ease, background .2s ease, border-color .2s ease;
}

.key:active { transform: translateY(1px); }

.key:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.key--op {
  background: linear-gradient(180deg, #232844, #161a2e);
  color: #cfd3ff;
}

.key--fn {
  color: var(--muted);
  background: linear-gradient(180deg, #20263e, #151a2d);
}

.key--eq {
  background: linear-gradient(180deg, var(--accent), #5f3dff);
  border-color: rgba(124,92,255,.55);
  font-weight: 700;
}

.key--eq:active { transform: translateY(1px) scale(.99); }

.key--wide {
  grid-column: span 2;
}

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

kbd {
  background: #111527;
  border: 1px solid #2a3152;
  border-bottom-color: #1a2142;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: #d8dcff;
  box-shadow: 0 2px 0 #0b0e1e;
}
