:root {
  --pine: #0e3b2c;
  --pine-2: #14533c;
  --card: #fffdf8;
  --ink: #1f2a2e;
  --muted: #667378;
  --line: #eadfce;
  --red: #c8102e;
  --red-dark: #9d0c24;
  --green: #1f7a4d;
  --gold: #f2b705;
  --blue: #2a7de1;
  --gift: #fff6da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(242, 183, 5, .14), transparent 30%),
    radial-gradient(circle at 85% 0%, rgba(200, 16, 46, .22), transparent 35%),
    linear-gradient(180deg, var(--pine) 0%, var(--pine-2) 60%, #0b2f23 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- string of lights (built by festive.js) ---------- */
.lights {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  height: 34px;
  padding: 0 8px;
  border-top: 3px solid #072219;
  overflow: hidden;
}
.lights i {
  width: 12px;
  height: 18px;
  margin-top: 6px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--c);
  box-shadow: 0 0 10px 3px var(--c);
  animation: twinkle 1.8s ease-in-out infinite;
  position: relative;
}
.lights i::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: #072219;
  border-radius: 2px;
}
.lights i:nth-child(2n) { animation-delay: .6s; margin-top: 10px; }
.lights i:nth-child(3n) { animation-delay: 1.2s; margin-top: 4px; }
@keyframes twinkle { 50% { opacity: .35; box-shadow: 0 0 3px 1px var(--c); } }

/* ---------- snow (built by festive.js) ---------- */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.snow span {
  position: absolute;
  top: -5vh;
  color: #fff;
  opacity: .8;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translate3d(var(--drift), 110vh, 0) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lights i { animation: none; }
  .snow { display: none; }
}

/* ---------- layout ---------- */
main { position: relative; z-index: 2; max-width: 660px; margin: 0 auto; padding: 12px 16px 48px; }
main.wide { max-width: 900px; }

header { text-align: center; margin: 12px 0 28px; color: #fff; }
header h1 {
  margin: 14px 0 0;
  font: 700 54px/1.05 "Mountains of Christmas", "Segoe Script", cursive;
  color: #fff;
  text-shadow: 0 3px 0 var(--red-dark), 0 6px 18px rgba(0, 0, 0, .35);
}
header h1 .g { color: var(--gold); }
header p { margin: 6px 0 0; color: #ffe9a8; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }

/* Company logo on a white plate, with a Santa hat hung on its corner. */
.logo {
  position: relative;
  display: inline-block;
  padding: 12px 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 4px rgba(242, 183, 5, .55);
}
.logo img.brand { display: block; height: 72px; width: auto; max-width: min(280px, 70vw); object-fit: contain; }
.logo img.hat {
  position: absolute;
  top: -34px;
  left: -30px;
  width: 78px;
  transform: rotate(-18deg);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}

.card {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  padding: 30px 26px 24px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  overflow: hidden;
}
/* candy-cane ribbon across the top of every card */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: repeating-linear-gradient(135deg, var(--red) 0 14px, #fff 14px 28px, var(--green) 28px 42px, #fff 42px 56px);
}
.card h2 { margin: 0 0 10px; font: 700 30px/1.1 "Mountains of Christmas", cursive; color: var(--red); }

.footer { text-align: center; font-size: 26px; letter-spacing: 10px; margin-top: 8px; }

/* ---------- forms ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }

label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 77, .2); }

button {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e0213f, var(--red));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--red-dark);
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dark); }
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: linear-gradient(180deg, #27935d, var(--green)); box-shadow: 0 3px 0 #155536; }
button.gold { background: linear-gradient(180deg, #ffd145, var(--gold)); color: #4a3600; box-shadow: 0 3px 0 #b88a00; }
button.small { padding: 6px 14px; font-size: 13px; box-shadow: none; }
button.plain {
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-weight: 400;
  text-decoration: underline;
  box-shadow: none;
}

.actions { margin-top: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.inline button { white-space: nowrap; }

.msg { margin: 12px 0 0; font-size: 14px; min-height: 1.4em; }
.msg.err { color: var(--red); font-weight: 600; }
.msg.ok { color: var(--green); font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }

/* ---------- organiser page ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; padding: 0; list-style: none; }
.steps li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3ece0;
  color: var(--muted);
  font-size: 14px;
  border: 2px solid transparent;
}
.steps li b { display: block; color: var(--ink); }
.steps li.now { background: var(--gift); border-color: var(--gold); }
.steps li.done { background: #e4f3ea; }
.steps li.done b::after { content: " ✔"; color: var(--green); }

.person { border: 2px solid var(--line); border-radius: 14px; margin-top: 12px; background: #fff; }
.person[open] { border-color: var(--gold); }
.person summary {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.person summary::-webkit-details-marker { display: none; }
.person summary::before { content: "🎁"; }
.person[open] summary::before { content: "📖"; }
.person .who { font-weight: 700; }
.person .mail { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.person .badge { margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f3ece0; color: var(--muted); white-space: nowrap; }
.person .badge.sent { background: #e4f3ea; color: var(--green); }
.person .badge.failed { background: #fde5e9; color: var(--red); cursor: help; }
.person .body { padding: 0 14px 14px; }
.person h3 { margin: 12px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.person p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  header h1 { font-size: 42px; }
  .steps { grid-template-columns: 1fr; }
  .card { padding: 28px 18px 20px; }
}

/* names of people who already joined */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.chips li { padding: 5px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #fff; background: var(--red); }
.chips li:nth-child(4n + 2) { background: var(--green); }
.chips li:nth-child(4n + 3) { background: var(--gold); color: #4a3600; }
.chips li:nth-child(4n + 4) { background: var(--blue); }
