body {
  background: #cfd3d8;
  font-family: Arial;
}

.calculator {
  width:520px;   /* 🔽 reduced from 880 */
  margin: 20px auto;
  background: #dfe3e8;
  padding:5px;
  border: 1px solid #999;
}

/* DISPLAY */
.display {
  height: 40px;   /* 🔽 smaller */
  background: #3f5f7a;
  color: white;
  text-align: right;
  padding: 8px;
  font-size: 18px;  /* 🔽 smaller text */
  margin-bottom: 6px;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;   /* 🔽 tighter spacing */
}

/* BUTTON */
button {
  height: 32px;   /* 🔽 smaller buttons */
  background: #cfd6dd;
  border: 1px solid #9aa5af;
  font-weight: bold;
  font-size: 13px;  /* 🔽 smaller text */
  cursor: pointer;
}

/* TYPES */
.num {
  background: #aebed0;
}

.op {
  background: #b9c7d6;
}

.equal {
  background: #8aa4bf;
  color: white;
}

/* RADIO BOX */
.radio-box {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #cfd6dd;
  border: 1px solid #9aa5af;
  font-size: 12px;  /* 🔽 smaller */
}

/* BACK BUTTON */
.wide {
  grid-column: span 1;
}/* CLICK FLASH EFFECT */
button {
  position: relative;
  overflow: hidden;
}

/* LIGHT BLINK */
button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: rgba(255,255,255,0.5);
  transform: skewX(-20deg);
}

/* ANIMATION */
button.flash::after {
  animation: shine 0.25s ease;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* PRESS FEEL */
button:active {
  filter: brightness(1.2);
  transform: scale(0.96);
}