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

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

.main-title {
  color: white;
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  animation: fadeInDown 0.8s ease;
}
.center-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  gap: 20px;
}

.calculator {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Historik */
.history {
  text-align: right;
  padding: 10px 15px;
  min-height: 30px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

#historyP {
  margin: 0;
}

/* Display */
.numBox {
  width: 320px;
  height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

#numP {
  color: white;
  font-size: 32px;
  font-weight: 300;
  margin: 0;
  word-break: break-all;
}

/* Knapp-layout */
.btnLayout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btnRow {
  display: flex;
  gap: 10px;
}

/* Alla knappar */
.numBtn,
.opeBtn,
.equalsBtn,
.clearBtn,
.backspaceBtn {
  display: flex;
  width: 75px;
  height: 65px;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Sifferknappar */
.numBtn {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-weight: 500;
}

.numBtn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.numBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.zero-btn {
  width: 160px;
}

.opeBtn {
  background: rgba(255, 165, 0, 0.8);
  color: white;
  font-weight: 600;
}

.opeBtn:hover {
  background: rgba(255, 165, 0, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.opeBtn:active {
  transform: translateY(0);
}

/* =-knappen */
.equalsBtn {
  background: rgba(76, 175, 80, 0.9);
  color: white;
  font-weight: 600;
  font-size: 28px;
}

.equalsBtn:hover {
  background: rgba(76, 175, 80, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.equalsBtn:active {
  transform: translateY(0);
}

.special-btn {
  background: rgba(244, 67, 54, 0.8);
  color: white;
  font-weight: 600;
}

.special-btn:hover {
  background: rgba(244, 67, 54, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.special-btn:active {
  transform: translateY(0);
}

@media (max-width: 400px) {
  .calculator {
    padding: 15px;
  }

  .numBox {
    width: 280px;
    height: 70px;
  }

  .numBtn,
  .opeBtn,
  .equalsBtn,
  .clearBtn,
  .backspaceBtn {
    width: 65px;
    height: 55px;
    font-size: 20px;
  }

  .zero-btn {
    width: 140px;
  }
}
