body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: white;
  padding: 20px;
}

.calculator {
  background: #242530;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 300px;
  position: relative;
}

#display {
  width: 100%;
  height: 60px;
  background: #3A3F77;
  border: none;
  border-radius: 15px;
  color: white;
  font-size: 24px;
  font-weight: 300;
  text-align: right;
  padding: 0 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.btn {
  width: 100%;
  aspect-ratio: 1/1;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.95);
}

.btn-number, .btn-decimal, .btn-delete {
  background: linear-gradient(145deg, #374151, #4b5563);
  color: white;
}

.btn-number:hover, .btn-decimal:hover, .btn-delete:hover {
  background: linear-gradient(145deg, #4b5563, #6b7280);
}

.btn-function {
  background: linear-gradient(145deg, #f97316, #fb923c);
  color: white;
  font-weight: 600;
}

.btn-function:hover {
  background: linear-gradient(145deg, #fb923c, #fdba74);
}

.btn-equals {
  background: linear-gradient(145deg, #9ca3af, #d1d5db);
  color: #374151;
  font-weight: 600;
}

.btn-equals:hover {
  background: linear-gradient(145deg, #d1d5db, #e5e7eb);
}

.history-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 250px;
  max-height: 80vh;
  background: #1f2937;
  color: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  z-index: 999;
  display: none;
  flex-direction: column;
}

.history-panel.show {
  display: flex;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-weight: bold;
}

#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: monospace;
}

#history-list li {
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .calculator {
    width: 90%;
    padding: 15px;
  }

  .btn {
    font-size: 16px;
  }

  #display {
    font-size: 20px;
    height: 50px;
    padding: 0 15px;
  }

  .history-panel {
    width: 90%;
    right: 5%;
  }
}
