:root {
  --bg: radial-gradient(circle at 10% 10%, #1c2b3f 0%, #0e1726 45%, #0a101a 100%);
  --card: rgba(20, 29, 43, 0.9);
  --accent: #e44747;
  --accent-soft: rgba(228, 71, 71, 0.14);
  --text: #e8f0ff;
  --muted: #9fb3d0;
  --border: #203049;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  --glow: 0 0 22px rgba(228, 71, 71, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  padding-bottom: 60px;
  min-height: 100vh;
}

.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 200px 150px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 80px 220px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(2px 2px at 300px 40px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 30px 320px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(2px 2px at 260px 260px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 160px 420px, rgba(255, 255, 255, 0.9), transparent);
  background-repeat: repeat;
  background-size: 300px 500px;
  animation: snow 12s linear infinite;
  opacity: 0.9;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 18px 90px;
  position: relative;
}

.lights {
  display: flex;
  justify-content: space-between;
  padding: 0 12px 10px;
  margin-bottom: 8px;
  position: relative;
}

.lights::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
  background: linear-gradient(90deg, rgba(232, 240, 255, 0.08), rgba(232, 240, 255, 0.3), rgba(232, 240, 255, 0.08));
}

.lights span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f1c40f;
  box-shadow: var(--glow);
  animation: twinkle 2s infinite alternate ease-in-out;
}

.lights span:nth-child(2n) { background: #2ecc71; animation-delay: 0.4s; }
.lights span:nth-child(3n) { background: #3498db; animation-delay: 0.8s; }
.lights span:nth-child(4n) { background: #e67e22; animation-delay: 1.2s; }

.page {
}

.hero {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(17, 26, 38, 0.85), rgba(26, 38, 55, 0.75));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 32px);
}

.lede {
  margin: 0;
  color: var(--muted);
}

.save-state {
  text-align: right;
  min-width: 120px;
}

#save-indicator {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f9d6d6;
  font-weight: 600;
  font-size: 14px;
}

.error {
  margin-top: 8px;
  background: #fff3f1;
  border: 1px solid #f0b5ac;
  color: #8c2f23;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.new-item {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 13px;
  color: var(--muted);
}

.filters input[type="search"],
.filters select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(17, 26, 38, 0.9);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.new-item input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(17, 26, 38, 0.9);
  font-size: 16px;
  color: var(--text);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  background: linear-gradient(135deg, #c62828, #e53935);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.error {
  margin-top: 8px;
  background: rgba(255, 76, 76, 0.12);
  border: 1px solid rgba(255, 119, 119, 0.35);
  color: #ffd6d6;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
}

.drag {
  width: 28px;
  text-align: center;
  color: var(--muted);
  cursor: grab;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.title-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
}

.item.done {
  border-color: #294234;
}

.item.done .title-input {
  text-decoration: line-through;
  color: #7da38f;
}

.title-input:focus,
.assignee:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff8f6;
}

.badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fdf2f2;
  background: var(--accent-soft);
  text-transform: uppercase;
}

.assignee-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.assignee {
  flex: 1;
  border: 1px solid var(--border);
  background: rgba(15, 23, 35, 0.85);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  min-height: 40px;
  color: var(--text);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

.assignee option {
  background: #0f1723;
  color: var(--text);
}

.assignee:focus {
  background-color: #131d2c;
  border-color: var(--accent);
}

.assignee option:checked,
.assignee option:hover {
  background: #1c2a3d;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.status input {
  width: 16px;
  height: 16px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.delete {
  background: none;
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 8px 10px;
}

.empty {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.is-dragging {
  opacity: 0.75;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

@media (max-width: 640px) {
  .item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .actions {
    justify-content: space-between;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .save-state {
    text-align: left;
  }
}

@keyframes snow {
  0% { background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px; }
  100% { background-position: 0px 700px, 0px 500px, 0px 600px, 0px 400px, 0px 520px, 0px 640px, 0px 560px, 0px 620px; }
}

@keyframes twinkle {
  from { filter: brightness(0.9); transform: translateY(0); }
  to { filter: brightness(1.2); transform: translateY(3px); }
}
