*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  background: #0a0a0f;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 8s ease-in-out infinite alternate;
}

.orb1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #00ff88, #00bcd4);
  top: -100px;
  left: -120px;
}

.orb2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #7c3aed, #ec4899);
  bottom: -80px;
  right: -80px;
  animation-delay: 3s;
}

@keyframes float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, 20px) scale(1.05);
  }
}
.wrapper {
  position: relative;
  z-index: 1;
  width: clamp(280px, 90vw, 360px);
  padding: 2.5rem 2rem 2rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1.4rem;
}

.label {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

#actual-count {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #ffffff;
  font-size: clamp(2.8rem, 8vw, 4rem);
  font-weight: 700;
  text-align: right;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.25s ease;
  font-variant-numeric: tabular-nums;
}
#actual-count.positive {
  color: #4ade80;
}
#actual-count.negative {
  color: #f87171;
}

.hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  line-height: 1.5;
}
.hint strong {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

#button {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  padding: 0.85rem 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.btn:active {
  transform: scale(0.94);
}
.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}
.btn-inc {
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.btn-inc:hover {
  background: rgba(74, 222, 128, 0.15);
}
.btn-inc.active {
  background: rgba(74, 222, 128, 0.25);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}
.btn-dec {
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}
.btn-dec:hover {
  background: rgba(248, 113, 113, 0.15);
}
.btn-dec.active {
  background: rgba(248, 113, 113, 0.25);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.4);
}
.btn-reset {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}
.btn-reset:hover {
  background: rgba(251, 191, 36, 0.15);
}
.btn-reset.active {
  background: rgba(251, 191, 36, 0.25);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}
.btn-save {
  border-color: rgba(167, 139, 250, 0.4);
  color: #a78bfa;
}
.btn-save:hover {
  background: rgba(167, 139, 250, 0.15);
}
.btn-save.active {
  background: rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.4);
}

/* Desktop */
@media (min-width: 1024px) {
  .bg-orb {
    filter: blur(100px);
  }
}
/* Tablet and medium screen */
@media (min-width: 768px) {
  .wrapper {
    max-width: 500px;
    padding: 3rem;
  }
  #actual-count {
    font-size: 6rem;
  }
  .btn {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 400px) {
  .wrapper {
    padding: 2rem 1.4rem 1.6rem;
    gap: 1.1rem;
  }
  #actual-count {
    font-size: 2.4rem;
  }
  .btn {
    font-size: 1.1rem;
    padding: 0.75rem 0;
  }
}
