:root {
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #7c5cff;
  --accent-2: #34d399;
  --danger: #fb7185;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124, 92, 255, 0.35), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(52, 211, 153, 0.25), transparent 60%),
    var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
}

.header {
  text-align: center;
  margin-bottom: 14px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  width: min(720px, 100%);
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.todo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.new-todo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#todoInput {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

#todoInput:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

#addBtn {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.18);
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
}

#addBtn:hover {
  background: rgba(124, 92, 255, 0.26);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.count {
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter,
.clear {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.filter[aria-pressed="true"] {
  border-color: rgba(124, 92, 255, 0.65);
  background: rgba(124, 92, 255, 0.18);
}

.clear {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
}

.clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 14px;
}

.item:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.check svg {
  width: 14px;
  height: 14px;
  fill: none;
}

.item.completed .check {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.15);
}

.text {
  min-width: 0;
}

.text .title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item.completed .text .title {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: line-through;
}

.item .delete {
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 800;
}

.item .delete:hover {
  background: rgba(251, 113, 133, 0.18);
}

.empty {
  display: none;
  padding: 18px 6px 6px;
  text-align: center;
  color: var(--muted);
}

.empty.visible {
  display: block;
}

.empty-title {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 6px;
}

.footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 520px) {
  .item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .item .delete {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .new-todo {
    grid-template-columns: 1fr;
  }
  #addBtn {
    width: 100%;
  }
}

