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

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
  min-height: 100vh;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  margin-top: 70px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

/* Calculator Container */
.container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
}

/* Display Box */
.calculation-box {
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 0.8rem 1rem;
  font-size: 2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  text-align: right;

  /* 👇 FIXED HEIGHT */
  height: 3.5rem;
  line-height: 3.5rem;

  /* 👇 PREVENT EXPANSION */
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;

  /* 👇 TEXT SCROLL HORIZONTALLY */
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Rows */
.row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  flex-wrap: nowrap;
}

/* Buttons */
.btn {
  flex: 1;
  margin: 0.3rem;
  padding: 1rem 0;
  font-size: 1.2rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(to bottom right, #434343, #262626);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn:hover {
  background: linear-gradient(to bottom right, #5a5a5a, #343434);
  transform: scale(1.05);
}

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

.btn-danger {
  background: linear-gradient(to right, #e53935, #e35d5b);
}

.btn-warning {
  background: linear-gradient(to right, #f9a825, #fdd835);
  color: #000;
}

.btn-equal {
  background: linear-gradient(to right, #1976d2, #64b5f6);
}

.btn-zero {
  flex: 2.1;
}

/* Responsive Design */
@media (max-width: 400px) {
  .btn {
    font-size: 1rem;
    padding: 0.9rem 0;
  }

  .calculation-box {
    font-size: 1.5rem;
    min-height: 2.8rem;
    line-height: 2.8rem;
  }
}

@media (max-width: 320px) {
  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 0;
  }

  .btn-zero {
    flex: 2;
  }

  .calculation-box {
    font-size: 1.4rem;
    min-height: 2.6rem;
    line-height: 2.6rem;
  }
}
