body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #111;
    color: #f0f0f0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  
  .calculator {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 20px;
    border: 1.5px solid #222;
    box-shadow: 0 16px 40px 0 rgba(76,161,175,0.25), 0 2px 8px 0 rgba(44,62,80,0.18), 0 1.5px 8px 0 rgba(44,62,80,0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 340px;
    padding: 20px;
    animation: fadeIn 1s ease;
    margin: 0 auto;
    transition: transform 0.35s cubic-bezier(.22,1,.36,1), box-shadow 0.35s cubic-bezier(.22,1,.36,1);
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .display {
    background: #181f24;
    color: #0f0;
    font-size: 2.2rem;
    padding: 20px;
    text-align: right;
    border-radius: 10px;
    box-shadow: inset 0 0 10px #0f0;
    margin-bottom: 20px;
    user-select: none;
    transition: box-shadow 0.3s;
  }
  
  .display:active {
    box-shadow: inset 0 0 15px #0f0;
  }
  
  .buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  
  button {
    font-size: 1.4rem;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: rgba(40, 40, 40, 0.8);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
  }
  
  button:hover {
    background: rgba(60, 60, 60, 0.9);
    transform: scale(1.05);
  }
  
  button:active {
    background: rgba(80, 80, 80, 1);
    transform: scale(0.95);
  }
  
  .equal {
    background-color: #4caf50;
    color: #fff;
  }
  
  .equal:hover {
    background-color: #388e3c;
  }
  
  button:nth-child(4n) {
    background-color: #f39c12;
    color: #fff;
  }
  
  button:nth-child(4n):hover {
    background-color: #e67e22;
  }
  .watermark {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 1px 1px 2px #000;
    animation: fadeInRight 1.5s ease;
    opacity: 0.8;
  }
  
  @keyframes fadeInRight {
    from {
      opacity: 0;
      transform: translateX(20px);
    }
    to {
      opacity: 0.8;
      transform: translateX(0);
    }
  }

  /* Responsive styles for mobile devices */
@media (max-width: 500px) {
  body {
    align-items: flex-start;
    justify-content: flex-start;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    overflow: auto;
  }
  .calculator {
    width: 94vw;
    min-width: unset;
    max-width: 350px;
    min-height: 80vh;
    height: auto;
    border-radius: 28px;
    padding: 10px 0 30px 0;
    box-shadow: 0 4px 24px 0 rgba(76,161,175,0.18), 0 1.5px 8px 0 rgba(44,62,80,0.10);
    border: 2.5px solid #4ca1af;
    background: #111;
    margin: 2vw auto 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    aspect-ratio: unset;
  }
  .display {
    font-size: 1.5rem;
    padding: 18px 10px;
    border-radius: 18px 18px 8px 8px;
    margin-bottom: 12px;
    min-height: 48px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0 0 0 3px #4ca1af, 0 2px 8px 0 rgba(44,62,80,0.10);
    background: #181f24cc;
    color: #0f0;
    border: none;
    position: relative;
    z-index: 2;
  }
  .buttons {
    gap: 6px;
    grid-template-columns: repeat(4, 1fr);
  }
  button {
    font-size: 1.1rem;
    padding: 14px 0;
    border-radius: 8px;
    min-width: 0;
    min-height: 44px;
  }
  .watermark {
    font-size: 0.7rem;
    right: 8px;
    bottom: 6px;
  }
}

/* Calculator wrapper for layout */
.calculator-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0;
  position: relative;
  gap: 32px;
}

.calculator {
  margin: 0;
  box-shadow: 0 16px 40px 0 rgba(76,161,175,0.25), 0 2px 8px 0 rgba(44,62,80,0.18), 0 1.5px 8px 0 rgba(44,62,80,0.10);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), box-shadow 0.35s cubic-bezier(.22,1,.36,1);
}

.calculator:hover, .calculator:focus-within {
  transform: translateY(-12px) scale(1.025);
  box-shadow: 0 32px 64px 0 rgba(76,161,175,0.32), 0 8px 24px 0 rgba(44,62,80,0.22);
}

.history {
  display: block;
  width: 200px;
  min-height: 400px;
  background: rgba(30,30,30,0.95);
  border-radius: 16px;
  border: 1.5px solid #222;
  box-shadow: 0 8px 32px 0 rgba(76,161,175,0.25), 0 2px 8px 0 rgba(44,62,80,0.18), 0 1.5px 8px 0 rgba(44,62,80,0.10);
  color: #f0f0f0;
  font-size: 1rem;
  padding: 16px 10px 16px 16px;
  overflow-y: auto;
  margin-left: 0;
  margin-top: 0;
  transition: background 0.3s, box-shadow 0.35s cubic-bezier(.22,1,.36,1), transform 0.35s cubic-bezier(.22,1,.36,1);
}
.history:hover, .history:focus-within {
  transform: translateY(-12px) scale(1.025);
  box-shadow: 0 32px 64px 0 rgba(76,161,175,0.32), 0 8px 24px 0 rgba(44,62,80,0.22);
}
.history h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  color: #4ca1af;
  font-weight: 600;
}
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history-list li {
  margin-bottom: 8px;
  word-break: break-all;
  color: #ccc;
}

@media (max-width: 900px) {
  .calculator-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: unset;
  }
  .history {
    width: 98vw;
    min-height: 80px;
    margin-left: 0;
    margin-top: 12px;
    border-radius: 16px;
    padding: 12px 8px 12px 12px;
  }
}

