* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  padding: 20px;
}

.calculator {
  width: 320px;
  background: #1c1c1e;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.display {
  padding: 20px 12px 12px;
  text-align: right;
  color: #fff;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.history {
  font-size: 18px;
  color: #8e8e93;
  min-height: 24px;
  word-break: break-all;
}

.current {
  font-size: 52px;
  font-weight: 300;
  word-break: break-all;
  line-height: 1.1;
}

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

.key {
  height: 64px;
  border: none;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  background: #333333;
  cursor: pointer;
  transition: filter 0.15s ease;
  user-select: none;
}

.key:hover { filter: brightness(1.2); }
.key:active { filter: brightness(0.85); }

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

.key-op {
  background: #ff9f0a;
  font-size: 30px;
}

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

.key-eq {
  background: #ff9f0a;
  font-size: 30px;
}

.key-zero {
  grid-column: span 2;
  border-radius: 32px;
  text-align: left;
  padding-left: 26px;
}
