* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #dbe7d3 0, transparent 35%),
    linear-gradient(135deg, #f4f1e8, #dce4d4);
  color: #1f2a24;
}

.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f7d70;
}

h1 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.1;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(34, 54, 43, 0.12);
  font-size: 1.2rem;
  cursor: pointer;
}

.input-card,
.stats-card,
.list-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(34, 54, 43, 0.13);
  backdrop-filter: blur(16px);
}

.input-card {
  padding: 18px;
  margin-bottom: 16px;
}

.input-card label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: 10px;
}

input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 1rem;
  background: #f7f6f0;
  color: #1f2a24;
  outline: none;
}

input:focus {
  box-shadow: 0 0 0 3px rgba(47, 79, 63, 0.2);
}

#addItemButton {
  width: 52px;
  border: none;
  border-radius: 16px;
  background: #2f4f3f;
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.stats-card div {
  padding: 10px 4px;
  border-radius: 16px;
  background: rgba(244, 241, 232, 0.7);
}

.stats-card span {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
}

.stats-card small {
  color: #68776a;
}

.list-card {
  padding: 12px;
  min-height: 220px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: #f7f6f0;
  animation: popIn 0.18s ease-out;
}

.shopping-item.done {
  opacity: 0.58;
}

.shopping-item.done .item-text {
  text-decoration: line-through;
}

.check-button {
  width: 28px;
  height: 28px;
  border: 2px solid #2f4f3f;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.9rem;
}

.shopping-item.done .check-button {
  background: #2f4f3f;
}

.item-text {
  flex: 1;
  font-size: 1rem;
  word-break: break-word;
}

.delete-button {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
}

.delete-button:hover {
  opacity: 1;
}

.empty-message {
  display: none;
  text-align: center;
  margin: 44px 20px;
  color: #718074;
  line-height: 1.5;
}

.empty-message.visible {
  display: block;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.8rem;
  }

  .app {
    padding: 18px 12px 30px;
  }
}