* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea, #764ba2);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #fff;
  width: 350px;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 15px 25px rgba(0,0,0,0.2);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #444;
}

.input-box {
  display: flex;
  gap: 10px;
}

input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
}

button {
  padding: 10px 15px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #5a67d8;
}

ul {
  list-style: none;
  margin-top: 20px;
}

li {
  background: #f4f4f4;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

li.completed {
  text-decoration: line-through;
  color: #888;
}

li span {
  cursor: pointer;
  flex: 1;
}

.delete-btn {
  background: #ff6b6b;
  border: none;
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.delete-btn:hover {
  background: #e63946;
}

.clear-btn {
  margin-top: 15px;
  width: 100%;
  padding: 8px;
  background: #48bb78;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.clear-btn:hover {
  background: #38a169;
}

/* ---------- Mobile First Improvements ---------- */

/* Make container responsive */
.container {
  width: 100%;
  max-width: 380px;
}

/* Better input & button size for touch */
input, button {
  font-size: 16px;
}

/* Stack input and button on very small screens */
@media (max-width: 480px) {
  .input-box {
    flex-direction: column;
  }

  .input-box button {
    width: 100%;
  }

  li {
    padding: 12px;
  }

  .delete-btn {
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Improve tap feedback */
button:active {
  transform: scale(0.98);
}

.counter {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
}

li input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
  cursor: pointer;
}

li span {
  flex: 1;
}