/* styles.css */
:root{
  --bg: #111016;
  --calc: #2D2A37;

  --text: #EBEBEB;
  --muted: rgba(235,235,235,0.65);

  --key: #2D2A37;
  --op: #462878;
  --eq: #7F45E2;

  --ce-accent: #975DFA;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue";
  background:
    radial-gradient(1200px 600px at 50% 20%, rgba(127,69,226,0.14), transparent 60%),
    radial-gradient(900px 500px at 20% 80%, rgba(151,93,250,0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
}

.stage{
  width: 460px;
  min-height: 686px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}

.calculator{
  position: relative;
  width: 356px;
  height: 566px;
  background: var(--calc);
  border-radius: 48px;

  /* Optimized shadows (same look, fewer layers) */
  box-shadow:
    0px 4px 10px rgba(0,0,0,0.35),
    0px 40px 80px rgba(0,0,0,0.35),
    inset 0px 6px 10px rgba(255,255,255,0.10),
    inset 0px -6px 10px rgba(0,0,0,0.22);

  padding: 28px 26px 18px;
  display:flex;
  flex-direction:column;
}

.display{
  height: 170px;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding: 14px 8px 0 8px;
}

.display__value{
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.5px;
  font-weight: 500;
  color: var(--text);
  text-align:right;
  width: 100%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  user-select: none;
}

.keys{
  margin-top: auto;
  display:grid;
  grid-template-columns: repeat(4, 64px);
  gap: 12px;
  justify-content: space-between;
  padding: 0 6px 6px;
}

.key{
  width: 64px;
  height: 64px;
  border-radius: 32px;
  border: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  background: var(--key);
  position: relative;

  box-shadow:
    0 0 0 1px rgba(0,0,0,0.16) inset,
    0px 10px 18px rgba(0,0,0,0.28);

  transition: transform 120ms ease, filter 120ms ease;
}

.key::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(255,255,255,0.06));
  opacity: 0.9;
  pointer-events:none;
}

.key:active{
  transform: translateY(1px) scale(0.99);
  filter: brightness(1.03);
}

.key--opcol{ background: var(--op); }
.key--eq{ background: var(--eq); }

.key--ce{
  color: var(--ce-accent);
  font-weight: 650;
}

.key:focus-visible{
  outline: 2px solid rgba(151,93,250,0.65);
  outline-offset: 3px;
}

.hint{
  margin: 10px 6px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  user-select: none;
}
