* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.calculator {
  width: 320px;
  max-width: 94vw;
  padding: 16px 12px 24px;
  background: #000;
}

.display-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px 18px 12px;
  min-height: 110px;
}

.display {
  color: #fff;
  font-size: 72px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  direction: rtl;
}

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

.key {
  border: none;
  outline: none;
  border-radius: 50%;
  aspect-ratio: 1;
  font-size: 30px;
  font-weight: 400;
  cursor: pointer;
  color: #fff;
  background: #333333;
  transition: filter 0.1s ease, background 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.key:active,
.key.active-key {
  filter: brightness(1.4);
}

.key.fn {
  background: #a5a5a5;
  color: #000;
}

.key.op {
  background: #ff9f0a;
  color: #fff;
}

.key.digit.zero {
  grid-column: span 2;
  border-radius: 40px;
  aspect-ratio: auto;
  text-align: left;
  padding-left: 28px;
}

.corner-note {
  position: fixed;
  right: 10px;
  bottom: 6px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: #444444;
  letter-spacing: 0.2px;
  user-select: none;
  pointer-events: none;
}
