:root {
  --red: #8e1b1b;
  --red-dark: #6b1212;
  --green: #1f5f3f;
  --gold: #e0b44c;
  --cream: #fff8ee;
  --ink: #2b1d16;
  --muted: #7a6656;
  --line: #ecdcc6;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% -10%, #b32c2c 0%, var(--red) 40%, #4a0d0d 100%) fixed;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Two layers of dots drifting down - CSS-only snow. */
.snow {
  position: fixed;
  inset: -100px 0 0;
  pointer-events: none;
  background-image:
    radial-gradient(3px 3px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 90px 140px, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 160px 60px, #fffc 50%, transparent 51%),
    radial-gradient(2px 2px at 230px 180px, #fff 50%, transparent 51%);
  background-size: 260px 220px;
  animation: snow 14s linear infinite;
  opacity: .8;
}
.snow-slow { background-size: 180px 160px; animation-duration: 24s; opacity: .45; }
@keyframes snow { to { background-position: 40px 220px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.top, main, .foot { position: relative; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 20px; padding-bottom: 12px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.star { color: var(--gold); }
.foot { color: #f5dcdc; font-size: .85rem; text-align: center; padding-top: 16px; padding-bottom: 32px; }

.card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: 0 10px 30px #0005;
  border-top: 6px solid var(--green);
}
.card.center { text-align: center; }
h1 { margin: 0 0 8px; font-size: 1.6rem; color: var(--red); }
h2 { margin: 0; font-size: 1.05rem; }
.lead { margin: 0 0 18px; }
.muted, .hint { color: var(--muted); font-size: .9rem; }
.hint { margin: 6px 0 0; }

.add { display: flex; gap: 8px; }
.add input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.add input:focus { outline: none; border-color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 10px;
  border: 2px solid var(--green);
  background: #fff;
  color: var(--green);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #eef6f0; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.big { width: 100%; margin-top: 18px; padding: 14px; font-size: 1.1rem; }

.link { background: none; border: 0; padding: 0; font: inherit; color: var(--red); text-decoration: underline; cursor: pointer; display: inline-block; margin-top: 14px; }
.list-head .link { margin: 0; font-size: .9rem; }

.status { min-height: 1.5em; margin: 8px 0 0; font-size: .95rem; color: var(--green); font-weight: 600; }
.status.error { color: #b00020; }
.status:empty { min-height: 0; margin: 0; }

.list-head { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 99px; background: var(--green); color: #fff; font-size: .85rem; text-align: center; }

.people { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people li { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 4px 4px 12px; }
.remove { border: 0; background: #f3e4d4; color: var(--red); width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.remove:hover { background: var(--red); color: #fff; }

.pairs { padding: 0; margin: 14px 0; list-style: none; counter-reset: p; }
.pairs li { counter-increment: p; padding: 10px 12px 10px 44px; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.pairs li::before { content: counter(p); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.arrow { color: var(--muted); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.actions .btn[hidden] { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 560px) {
  .top { padding-top: 36px; }
  .card { padding: 30px 32px; }
  h1 { font-size: 2rem; }
}

.foot-link { background: none; border: 0; padding: 0; margin-left: 6px; font: inherit; color: #f5dcdc; text-decoration: underline; cursor: pointer; }

/* Cookie consent: small bar pinned to the bottom; body gets matching padding so it never covers buttons. */
.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  max-width: 616px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  background: var(--cream);
  border-top: 4px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 8px 24px #0006;
  font-size: .85rem;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.consent .btn { padding: 6px 12px; font-size: .85rem; }
