/* ================= GLOBAL RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, #1e1e2f, #111118);
}

/* ================= CALCULATOR CONTAINER ================= */
.calculator {
  width: 100%;
  max-width: 400px;
  background: #1c1c25;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ================= DISPLAY ================= */
.displayText {
  height: 80px;
  background: #0f0f16;
  border-radius: 12px;
  margin-bottom: 20px;
  padding: 15px;
  font-size: 2rem;
  text-align: right;
  color: #fff;
  overflow-x: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ================= BUTTON GRID ================= */
.buttonHolder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ================= BUTTONS ================= */
button {
  height: 65px;
  border-radius: 12px;
  border: none;
  font-size: 1.3rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Number buttons */
button:not(.operator):not(.special) {
  background: #2a2a3a;
  color: #fff;
}

.clear {
  background: #ffffff;
  color: #1c1c25;
}

.backspace {
  background: #f1f1f1;
  color: #1c1c25;
}

/* Operator buttons */
.operator {
  background: #ff9500;
  color: white;
}

.equal {
  background: #9be37e;
  color: #103503;
}

/* Special buttons (clear, backspace, equals) */
.special {
  background: #3a3a55;
  color: white;
}

/* Hover effect (desktop only) */
@media (hover: hover) {
  button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
  }
}

/* Active press effect */
button:active {
  transform: scale(0.95);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
  .calculator {
    width: 95%;
    padding: 15px;
  }

  .displayText {
    font-size: 1.6rem;
    height: 70px;
  }

  button {
    height: 55px;
    font-size: 1.1rem;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  body {
    align-items: flex-start;
    padding: 8px;
  }

  .calculator {
    max-width: 720px;
    padding: 12px;
  }

  .displayText {
    height: 54px;
    margin-bottom: 12px;
    font-size: 1.4rem;
  }

  button {
    height: 44px;
    font-size: 1rem;
  }
}
