/* Credit: lautandigital.id */

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
}

.calculator {
  width: 400px;
  max-width: 100%;
  background: #1e1e2f;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.display {
  background: #12121c;
  border-radius: 10px;
  padding: 20px 16px;
  margin-bottom: 16px;
  text-align: right;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.expression {
  color: #9a9ab0;
  font-size: 16px;
  min-height: 20px;
  word-wrap: break-word;
}

.result {
  color: #ffffff;
  font-size: 32px;
  font-weight: 600;
  overflow-x: auto;
  white-space: nowrap;
}

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

.sci-buttons {
  grid-template-columns: repeat(5, 1fr);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  background: #2b2b3d;
  color: #ffffff;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover {
  filter: brightness(1.15);
}

.btn:active {
  transform: scale(0.95);
}

.btn-number {
  background: #2b2b3d;
}

.btn-operator {
  background: #ff9f43;
  color: #1e1e2f;
}

.btn-clear {
  background: #4a4a63;
}

.btn-equal {
  background: #4cd964;
  color: #1e1e2f;
  grid-column: span 2;
}

.btn-zero {
  grid-column: span 1;
}

.btn-sci {
  background: #34344a;
  color: #c9c9e8;
  font-size: 14px;
  padding: 12px 0;
}

.btn-toggle {
  background: #5a5a7a;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
}

.btn-toggle.active-rad {
  background: #7c6cf6;
}

.credit {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #6f6f89;
}
