*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Poppins',sans-serif;
  background: linear-gradient(270deg,#1c1c1c,#2a2a2a,#1c1c1c);
  background-size:600% 600%;
  animation:waterflow 20s ease infinite;
  -webkit-animation:waterflow 20s ease infinite;
  background-attachment: fixed;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
@media (max-width:768px){ body{ background-attachment:scroll; padding:12px } }

@keyframes waterflow{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}

.container{
  width:100%;
  max-width:380px;
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:center;
}

.card{
  width:100%;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:16px;
  padding:20px;
  box-shadow:0 12px 30px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}

.display{
  background: rgba(0,0,0,0.36);
  padding:16px 14px;
  border-radius:12px;
  min-height:70px;
  font-size:1.8rem;
  text-align:right;
  overflow-x:auto;
  white-space:nowrap;
  margin-bottom:16px;
}

.grid{
  display:grid;
  gap:10px;
  grid-template-columns: repeat(4, 1fr);
}

.btn{
  border: none;
  padding:16px;
  border-radius:12px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size:1.2rem;
  cursor:pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.45);
  transition: transform .12s ease, background .12s ease;
}
.btn:active{ transform: translateY(2px) }
.btn:hover{ background: rgba(0,120,255,0.14) }

.op{ background: linear-gradient(180deg, rgba(0,120,255,0.82), rgba(0,96,200,0.82)); color:#fff }
.eq { background: linear-gradient(180deg,#00ffab,#00e594); color:#000; grid-row:5; }
.clear{ background: linear-gradient(180deg,#ff6b6b,#ff4b4b); color:#fff }
.wide2 { grid-column: span 2 }

@media (max-width:520px){
  .grid{ grid-template-columns: repeat(4, 1fr); gap:8px; }
  .display{ font-size:1.5rem; min-height:60px }
}

.footer{
  width:90%;
  max-width:360px;
  text-align:center;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,0.14);
  color:#ccc;
  font-size:0.95rem;
  margin-top:12px;
  border-radius:6px;
}

/* Sidebar */
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0; left: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: hidden;
  transition: 0.3s;
  padding-top: 60px;
  z-index: 1000;
}

.sidebar a {
  padding: 12px 25px;
  text-decoration: none;
  font-size: 18px;
  color: #ccc;
  display: block;
  transition: 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar.open { width: 250px; }

/* Hamburger */
.hamburger {
  position: fixed;
  top: 20px;
  left: 20px;
  cursor: pointer;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 30px;
  height: 3px;
  margin: 6px;
  background: white;
  transition: 0.3s;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
