:root {
  --night: #08051c;
  --violet: #160b35;
  --panel: rgba(16, 10, 39, 0.76);
  --panel-edge: rgba(127, 101, 255, 0.42);
  --neon: #16f2dc;
  --pink: #ff43e1;
  --gold: #f7d788;
  --mist: #ddd8ff;
  --muted: #8c88b8;
  --danger: #ff5e92;
  --shadow: 0 24px 80px rgba(4, 1, 20, 0.7);
  font-family: Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--mist);
  background:
    radial-gradient(circle at 67% 10%, rgba(52, 223, 218, 0.13), transparent 29%),
    radial-gradient(circle at 17% 20%, rgba(245, 58, 231, 0.12), transparent 28%),
    linear-gradient(130deg, #060414 0%, var(--night) 38%, #120728 100%);
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky::before,
.sky::after {
  position: absolute;
  content: "";
  filter: blur(60px);
  border-radius: 50%;
}

.sky::before {
  width: 380px;
  height: 380px;
  top: 52%;
  left: -150px;
  background: rgba(235, 50, 229, 0.16);
}

.sky::after {
  width: 440px;
  height: 440px;
  right: -200px;
  bottom: -90px;
  background: rgba(11, 241, 220, 0.13);
}

.moon {
  position: absolute;
  width: min(42vw, 460px);
  aspect-ratio: 1;
  top: -170px;
  right: -60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 40%, #fef4de, #bd91d4 47%, #57296d 78%);
  box-shadow: 0 0 80px rgba(248, 207, 123, 0.27);
  opacity: 0.38;
}

.rune {
  position: absolute;
  font: 600 clamp(9rem, 23vw, 22rem) Cinzel, serif;
  color: transparent;
  -webkit-text-stroke: 1px rgba(24, 242, 220, 0.12);
  text-shadow: 0 0 30px rgba(22, 242, 220, 0.1);
  transform: rotate(18deg);
}

.rune-one {
  left: 2vw;
  top: 20vh;
}

.rune-two {
  right: 3vw;
  bottom: -5vh;
  color: rgba(255, 67, 225, 0.025);
  -webkit-text-stroke-color: rgba(255, 67, 225, 0.1);
}

.grid {
  position: absolute;
  height: 41vh;
  left: -15%;
  right: -15%;
  bottom: -12vh;
  transform: perspective(480px) rotateX(62deg);
  background-image:
    linear-gradient(rgba(22, 242, 220, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 242, 220, 0.1) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(transparent, #000 30%, #000 66%, transparent);
}

.app-shell {
  position: relative;
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(45px, 7vh, 78px) 0 44px;
}

.hero {
  text-align: center;
  margin-bottom: 32px;
}

.kicker,
.section-label {
  margin: 0 0 10px;
  color: var(--neon);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--gold);
  font: clamp(2.85rem, 8vw, 5rem) Cinzel, Georgia, serif;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(248, 212, 132, 0.24);
}

h1 span {
  color: var(--neon);
  text-shadow: 0 0 25px rgba(22, 242, 220, 0.45);
}

.intro {
  max-width: 600px;
  margin: 13px auto 0;
  color: var(--muted);
  line-height: 1.55;
}

.ledger {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  border-radius: 25px;
  padding: clamp(21px, 5vw, 38px);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.047), transparent 25%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.ledger::after {
  position: absolute;
  content: "";
  top: 0;
  left: 17%;
  width: 68%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), var(--pink), transparent);
  box-shadow: 0 0 13px var(--neon);
}

.ledger-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.ledger-head h2 {
  margin: 0;
  color: #fcf7e9;
  font: 600 clamp(1.5rem, 4vw, 1.95rem) Cinzel, serif;
}

.progress {
  min-width: 92px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 242, 220, 0.2);
  border-radius: 13px;
  color: var(--neon);
  text-align: center;
  font-weight: 700;
  font-size: 1.25rem;
  background: rgba(6, 26, 38, 0.45);
}

.progress small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.task-form {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
}

.task-form input,
.edit-input {
  width: 100%;
  border: 1px solid rgba(106, 89, 179, 0.48);
  border-radius: 13px;
  padding: 15px 18px;
  outline: 0;
  color: #f4f2ff;
  background: rgba(7, 7, 27, 0.68);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.task-form input::placeholder {
  color: #77749b;
}

.task-form input:focus,
.edit-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(22, 242, 220, 0.13), 0 0 21px rgba(22, 242, 220, 0.12);
}

.task-form button {
  display: flex;
  align-items: center;
  gap: 17px;
  border: 0;
  border-radius: 13px;
  padding: 0 17px 0 22px;
  color: #041b21;
  background: linear-gradient(104deg, #0edecf, #26eab6);
  font: 700 0.84rem Inter, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(22, 242, 220, 0.27);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.task-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 31px rgba(22, 242, 220, 0.44);
}

.task-form strong {
  font-size: 1.55rem;
  font-weight: 400;
}

.filters {
  display: flex;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(105, 92, 167, 0.28);
}

.filters button,
.ledger-footer button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 17px;
  color: var(--muted);
  background: transparent;
  font: 600 0.8rem Inter, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.filters button:hover,
.filters button.active {
  border-color: rgba(255, 67, 225, 0.52);
  color: #fff;
  background: rgba(255, 67, 225, 0.16);
  box-shadow: inset 0 0 16px rgba(255, 67, 225, 0.08);
}

.task-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.task {
  display: flex;
  align-items: center;
  min-height: 62px;
  margin: 10px 0;
  padding: 9px 13px;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(7, 5, 25, 0.36);
  transition: border-color 170ms ease, background 170ms ease;
}

.task:hover {
  border-color: rgba(121, 101, 214, 0.3);
  background: rgba(18, 12, 44, 0.7);
}

.check {
  flex: none;
  cursor: pointer;
}

.check input {
  position: absolute;
  opacity: 0;
}

.check span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #5a517a;
  border-radius: 50%;
  transition: all 170ms ease;
}

.check input:checked + span {
  border-color: var(--neon);
  background: rgba(22, 242, 220, 0.18);
  box-shadow: 0 0 14px rgba(22, 242, 220, 0.45);
}

.check input:checked + span::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--neon);
  border-bottom: 2px solid var(--neon);
  transform: translateY(-2px) rotate(-45deg);
}

.task-content {
  min-width: 0;
  flex: 1;
}

.task-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
  color: #e7e2fc;
}

.task.completed .task-title {
  color: #696685;
  text-decoration: line-through;
  text-decoration-color: #716c91;
}

.edit-form {
  display: none;
}

.task.editing .task-title {
  display: none;
}

.task.editing .edit-form {
  display: block;
}

.edit-input {
  padding: 9px 12px;
}

.actions {
  display: flex;
  gap: 7px;
}

.actions button {
  height: 33px;
  border: 1px solid rgba(120, 105, 180, 0.4);
  border-radius: 8px;
  color: #aaa3d0;
  background: transparent;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.edit {
  padding: 0 10px;
}

.delete {
  width: 34px;
}

.actions .edit:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 13px rgba(22, 242, 220, 0.18);
}

.actions .delete:hover {
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 13px rgba(255, 94, 146, 0.17);
}

.empty-state {
  display: none;
  padding: 42px 10px 25px;
  color: var(--muted);
  text-align: center;
}

.empty-state.visible {
  display: block;
}

.crystal {
  width: 40px;
  height: 45px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, rgba(255, 67, 225, 0.7), rgba(22, 242, 220, 0.85));
  clip-path: polygon(50% 0, 100% 29%, 78% 100%, 22% 100%, 0 29%);
  box-shadow: 0 0 18px var(--pink);
  opacity: 0.65;
}

.ledger-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 21px;
  padding-top: 19px;
  border-top: 1px solid rgba(105, 92, 167, 0.28);
  color: var(--muted);
  font-size: 0.85rem;
}

.ledger-footer button {
  padding-right: 0;
}

.ledger-footer button:hover:not(:disabled) {
  color: var(--pink);
}

.ledger-footer button:disabled {
  opacity: 0.38;
  cursor: default;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 920px);
    padding-top: 36px;
  }

  .intro {
    font-size: 0.92rem;
  }

  .ledger-head {
    align-items: center;
  }

  .task-form {
    flex-direction: column;
  }

  .task-form button {
    justify-content: center;
    height: 50px;
  }

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

  .filters button {
    flex: 1;
    padding-inline: 5px;
  }

  .task {
    gap: 9px;
    padding-inline: 9px;
  }

  .actions .edit {
    padding-inline: 7px;
  }
}
