:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Segoe UI, Roboto, Arial, sans-serif;
  background: #10131a;
  color: #f3f5f8;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.calculator {
  width: min(100%, 340px);
  background: #1a1f2b;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.calculator h1 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 600;
}

.display {
  min-height: 70px;
  border-radius: 10px;
  padding: 16px;
  background: #0f141d;
  font-size: 2rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 14px;
}

.keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.key {
  border: 0;
  border-radius: 10px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  background: #2c3343;
  color: #f7f8fb;
  cursor: pointer;
}

.key:hover {
  filter: brightness(1.1);
}

.key-op {
  background: #3a6ee8;
}

.key-eq {
  background: #16a34a;
}

.key-func {
  background: #4b5563;
}

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