/* Family Christmas Gift Exchange — festive theme */
:root {
  --pine: #0f3d2e;
  --pine-deep: #082519;
  --holly: #1f6b47;
  --berry: #b3192b;
  --berry-dark: #8a0f1f;
  --gold: #e8b64c;
  --cream: #fff9ef;
  --paper: #fffdf8;
  --ink: #2a1f1a;
  --muted: #7a6a5d;
  --line: #ead9c2;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { background: var(--pine-deep); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(232,182,76,.18), transparent 50%),
    radial-gradient(ellipse at 90% 30%, rgba(179,25,43,.25), transparent 55%),
    linear-gradient(180deg, var(--pine) 0%, var(--pine-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- falling snow (pure CSS) ---------- */
.snow, .snow::before, .snow::after {
  position: fixed; inset: -100px 0 0 0;
  pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(3px 3px at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 30% 60%, #fff 50%, transparent 51%),
    radial-gradient(4px 4px at 50% 10%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 40%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 85% 75%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(2px 2px at 20% 85%, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 60% 90%, rgba(255,255,255,.85) 50%, transparent 51%);
  background-size: 400px 400px;
  animation: snow 18s linear infinite;
  opacity: .7;
}
.snow::before { content: ""; background-size: 280px 280px; animation-duration: 12s; opacity: .5; }
.snow::after  { content: ""; background-size: 520px 520px; animation-duration: 26s; opacity: .6; }
@keyframes snow {
  from { background-position: 0 0; }
  to   { background-position: 60px 400px; }
}

/* ---------- header & string of lights ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 20px;
  padding: 18px max(16px, calc((100vw - 1000px) / 2));
}
.brand {
  font-family: "Mountains of Christmas", Georgia, serif;
  font-size: clamp(26px, 5vw, 38px);
  color: var(--cream); text-decoration: none;
  text-shadow: 0 2px 0 var(--berry-dark), 0 0 18px rgba(232,182,76,.4);
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
nav a, nav .link {
  color: var(--cream); text-decoration: none; font-weight: 600; font-size: 15px;
  background: none; border: 0; padding: 4px 0; cursor: pointer; font-family: inherit;
  border-bottom: 2px solid transparent;
}
nav a:hover, nav .link:hover { border-bottom-color: var(--gold); }

.lights {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between;
  padding: 0 12px; height: 34px; overflow: hidden;
  border-top: 2px solid rgba(0,0,0,.35);
  margin: 0 0 8px;
}
.lights i {
  display: block; width: 12px; height: 20px; margin-top: 4px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--berry);
  box-shadow: 0 4px 16px 3px var(--berry);
  animation: twinkle 2.4s ease-in-out infinite;
  position: relative;
}
.lights i::before {
  content: ""; position: absolute; top: -5px; left: 3px;
  width: 6px; height: 6px; background: #333; border-radius: 2px;
}
.lights i:nth-child(4n+2) { background: var(--gold);  box-shadow: 0 4px 16px 3px var(--gold);  animation-delay: .6s; }
.lights i:nth-child(4n+3) { background: #39b36b;      box-shadow: 0 4px 16px 3px #39b36b;      animation-delay: 1.2s; }
.lights i:nth-child(4n+4) { background: #4aa3df;      box-shadow: 0 4px 16px 3px #4aa3df;      animation-delay: 1.8s; }
.lights i:nth-child(odd) { margin-top: 9px; }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .35; box-shadow: none; } }

/* ---------- layout ---------- */
main {
  position: relative; z-index: 2;
  max-width: 1000px; margin: 0 auto; padding: 8px 16px 40px;
}
footer {
  position: relative; z-index: 2;
  text-align: center; color: rgba(255,249,239,.6); font-size: 14px; padding: 10px 16px 30px;
}

.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px clamp(18px, 4vw, 34px);
  margin: 0 0 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  border: 1px solid var(--line);
}
/* gift-ribbon stripe along the top of each card */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(-45deg, var(--berry) 0 14px, var(--cream) 14px 28px);
}
.card.hero, .card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card.hero { text-align: center; margin-top: 30px; }
.card.hero .stack { text-align: left; }

h1, h2 {
  font-family: "Mountains of Christmas", Georgia, serif;
  color: var(--berry);
  margin: 4px 0 12px; line-height: 1.1;
}
h1 { font-size: clamp(34px, 6vw, 46px); }
h2 { font-size: 30px; color: var(--holly); }
h3 { margin: 22px 0 10px; font-size: 18px; }

p { line-height: 1.55; }
.hint, .muted { color: var(--muted); font-size: 14px; font-weight: 400; }
.empty { color: var(--muted); font-style: italic; }

/* ---------- forms ---------- */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
label.check { display: flex; align-items: center; gap: 10px; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
  width: 100%; min-width: 0;
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--holly); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(232,182,76,.5); border-color: var(--gold); }
textarea { resize: vertical; }

button {
  font: inherit; font-weight: 800; font-size: 16px;
  color: #fff; background: var(--berry);
  border: 0; border-radius: 999px; padding: 11px 22px;
  cursor: pointer; box-shadow: 0 3px 0 var(--berry-dark);
  transition: transform .08s, background .15s;
}
button:hover { background: #c8203a; }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--berry-dark); }
button:disabled { background: #b9aaa0; box-shadow: none; cursor: not-allowed; }
button.big { font-size: 19px; padding: 14px 28px; }
button.small { font-size: 14px; padding: 7px 14px; }
button.ghost { background: transparent; color: var(--holly); box-shadow: inset 0 0 0 2px var(--holly); }
button.ghost:hover { background: rgba(31,107,71,.08); }
button.danger { background: transparent; color: var(--berry-dark); box-shadow: inset 0 0 0 1.5px var(--berry-dark); }
button.danger:hover { background: rgba(179,25,43,.08); }
form.inline { display: inline; margin: 0; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin: 6px 0; }
.addrow input { flex: 1 1 180px; }
.addrow select { flex: 0 1 160px; }

/* ---------- messages ---------- */
.flash {
  padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 600;
  background: #e7f5ec; color: #14532d; border: 1px solid #b7e0c4;
}
.flash.error { background: #fde8ea; color: #7f1020; border-color: #f4b8c0; }
.flash.warn  { background: #fff4d6; color: #6b4a00; border-color: #f1d690; }
.banner {
  background: linear-gradient(90deg, #fff4d6, #fdf8ec);
  border: 1px dashed var(--gold); border-radius: 12px; padding: 12px 16px; font-weight: 600;
}

/* ---------- people cards ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.person {
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.person.out { opacity: .65; }
.person header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.person h3 { margin: 0; font-size: 20px; flex: 1 1 auto; }
.tag {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; background: #e7f5ec; color: var(--holly);
}
.tag.adults { background: #fde8ea; color: var(--berry-dark); }
.tag.sit { background: #eee; color: #666; }

details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details.edit summary, details.mini summary { color: var(--holly); font-size: 14px; }
details.edit summary::before, details.mini summary::before { content: "✎ "; }
details.edit[open] { border-top: 1px dashed var(--line); padding-top: 10px; }
details.edit .stack { margin: 10px 0; }

details.reveal summary {
  background: var(--berry); color: #fff; padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 3px 0 var(--berry-dark); text-align: center;
}
details.reveal[open] summary { border-radius: 12px 12px 0 0; box-shadow: none; }
.drawn {
  background: #fff; border: 2px solid var(--berry); border-top: 0; border-radius: 0 0 12px 12px;
  padding: 14px; text-align: center; animation: pop .35s ease-out;
}
.drawn strong {
  display: block; font-family: "Mountains of Christmas", Georgia, serif;
  font-size: 34px; color: var(--holly); line-height: 1.1;
}
.wish { text-align: left; margin-top: 12px; padding: 10px 12px; background: var(--cream); border-radius: 10px; font-size: 15px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
section > details.reveal { margin-top: 18px; }
section > details.reveal table { border: 2px solid var(--berry); border-top: 0; border-radius: 0 0 12px 12px; }

.past { margin: 0; font-size: 13px; color: var(--muted); }
.past span { display: inline-block; margin: 2px 4px 0 0; padding: 1px 8px; border-radius: 999px; background: #f3eadc; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--cream); }
td a { color: var(--berry); font-weight: 700; }
td.actions { min-width: 120px; }
details.mini[open] { display: grid; gap: 8px; min-width: 240px; }

.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 700;
  background: var(--cream); color: var(--holly); border: 1.5px solid var(--line);
}
.chip.on { background: var(--holly); color: #fff; border-color: var(--holly); }

/* ---------- family tree ---------- */
.treecard { text-align: center; }
.treecard .banner { text-align: left; display: inline-block; }
.treecard .banner a { color: var(--berry); font-weight: 800; }
.sub { margin: -6px 0 14px; color: var(--muted); font-weight: 600; }
.center { text-align: center; }
.treewrap {
  margin: 10px auto 0; max-width: 640px;
  background: radial-gradient(ellipse at 50% 35%, #fff7e3 0%, var(--paper) 70%);
  border-radius: 14px;
}
svg.tree { display: block; width: 100%; height: auto; }
svg.tree .lbl {
  font: 800 12px "Nunito", system-ui, sans-serif; text-anchor: middle; fill: #fff;
  stroke: #0b3320; stroke-width: 3.5px; paint-order: stroke; stroke-linejoin: round;
}
svg.tree .orn { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4s ease-in-out infinite; animation-delay: var(--d); }
svg.tree .orn.out { opacity: .4; }
svg.tree .orn .halo { animation: sparkle 1.6s ease-in-out infinite; }
svg.tree .starglow { animation: sparkle 3s ease-in-out infinite; }
svg.tree .bulb { animation: twinkleBulb 2.6s ease-in-out infinite; animation-delay: var(--d); }
svg.tree .bulb .bglow { animation: sparkle 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkleBulb { 0%,100% { opacity: 1; } 45% { opacity: .55; } 55% { opacity: .4; } }
svg.tree .tag1 { font: 700 15px "Mountains of Christmas", Georgia, serif; fill: var(--berry); text-anchor: middle; }
svg.tree .tag2 { font: 700 13px "Mountains of Christmas", Georgia, serif; fill: var(--holly); text-anchor: middle; }
svg.tree .chug { animation: chug .7s ease-in-out infinite; }
svg.tree .smoke circle { fill: #fff; opacity: .85; animation: puff 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
svg.tree .smoke circle:nth-child(2) { animation-delay: .5s; }
svg.tree .smoke circle:nth-child(3) { animation-delay: 1s; }
@keyframes sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes sparkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes chug { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes puff { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.4) translateY(-6px); opacity: 0; } }

.legend {
  list-style: none; padding: 0; margin: 18px 0 6px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
}
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset -3px -3px 0 rgba(0,0,0,.18); }
.tag.ok { background: #e7f5ec; color: var(--holly); }
.tag.wait { background: #fff4d6; color: #7a5600; }
.tag.grands { background: #f3e8ff; color: #6b2fa0; }


/* ---------- Santa's Scroll ---------- */
.scrollwrap { max-width: 520px; margin: -6px auto 26px; position: relative; z-index: 1; }
.scrollwrap { filter: drop-shadow(0 8px 14px rgba(60,30,0,.25)); }
.scrollwrap .rod {
  height: 22px; margin: 0 -14px; border-radius: 11px;
  background: linear-gradient(180deg, #8a5a2b 0%, #c98d4e 35%, #f0c58a 50%, #b07338 70%, #6e4420 100%);
  position: relative;
}
.scrollwrap .rod::before, .scrollwrap .rod::after {
  content: ""; position: absolute; top: -3px; width: 18px; height: 28px; border-radius: 6px;
  background: radial-gradient(circle at 40% 35%, #f5d27a, #b8862a 70%);
}
.scrollwrap .rod::before { left: -10px; }
.scrollwrap .rod::after { right: -10px; }
.scroll .parch {
  margin: -6px 0; padding: 22px clamp(18px, 5vw, 38px) 20px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(160,110,40,.18), transparent 60%),
    linear-gradient(90deg, #e9cf98 0%, #f8e8c3 8%, #fbf0d4 50%, #f8e8c3 92%, #e9cf98 100%);
  color: #4a2c12; text-align: center;
  font-family: Georgia, "Times New Roman", serif;
}
.scroll .parch h2 { color: var(--berry); margin: 4px 0 2px; font-size: 34px; }
.scroll .parch h3 {
  font-family: "Mountains of Christmas", Georgia, serif; color: var(--holly);
  font-size: 22px; margin: 16px 0 6px; border-bottom: 1px dashed rgba(74,44,18,.35); padding-bottom: 4px;
}
.scrollsub { margin: 0 0 6px; font-style: italic; color: #7a5a3a; }
.matches { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 18px; }
.matches li {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  font-size: 18px; padding: 3px 0; font-style: italic;
}
.matches .giver { font-weight: 700; }
.matches .getter { font-weight: 700; color: var(--berry-dark); }
.matches .arrow { font-style: normal; font-size: 15px; }
.quill { font-style: italic; color: #7a5a3a; margin: 10px 0 4px; }
.hush { font-size: 13px; color: #8a6a4a; margin: 16px 0 0; font-style: italic; }

/* clickable scroll: rolled up until tapped */
.scroll > summary { list-style: none; cursor: pointer; display: block; }
.scroll > summary::-webkit-details-marker { display: none; }
.scroll .parch.head { margin-bottom: 0; padding-bottom: 14px; }
.scroll .parch.body { margin-top: 0; padding-top: 1px; display: flow-root; animation: unroll .45s ease-out; transform-origin: top; }
.scroll[open] > summary .parch.head { padding-bottom: 4px; }
.scroll .tapme { margin: 8px 0 0; font-size: 15px; font-style: italic; color: #7a4a1a; }
.scroll .when-open, .scroll[open] .when-closed, .scroll[open] .seal { display: none; }
.scroll[open] .when-open { display: block; font-size: 13px; color: #9a7a5a; }
.scroll:not([open]) > summary:hover .seal { transform: rotate(-8deg) scale(1.06); }
.scroll:not([open]) > summary .seal { animation: nudge 3s ease-in-out infinite; }
.scrollwrap .closed-rod { display: block; }
.scrollwrap:has(.scroll[open]) .closed-rod, .scroll:not([open]) .rod.bottom { display: none; }
@keyframes unroll { from { transform: scaleY(.2); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes nudge { 0%,85%,100% { transform: rotate(0); } 90% { transform: rotate(-10deg); } 95% { transform: rotate(8deg); } }
.scroll .rod.bottom, .scrollwrap .closed-rod { margin-top: -6px; }
.seal {
  width: 64px; height: 64px; margin: 8px auto 2px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 30px "Mountains of Christmas", Georgia, serif; color: #f6d5d5;
  background: radial-gradient(circle at 35% 30%, #e0384e, #9c0f22 60%, #6f0716);
  box-shadow: 0 0 0 5px rgba(156,15,34,.35), 0 3px 6px rgba(0,0,0,.3);
  border: 2px dashed rgba(255,220,220,.45);
  transition: transform .2s;
}

/* ---------- readiness ---------- */
.readybox {
  border: 2px dashed var(--gold); border-radius: 14px; padding: 14px 18px; margin: 0 0 8px;
  background: #fffaf0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.readybox p { margin: 0; flex: 1 1 280px; }
.readybox.on { border-style: solid; border-color: #b7e0c4; background: #f0faf3; }
button.pill { font-size: 13px; padding: 5px 12px; box-shadow: none; }
button.pill.yes { background: #e7f5ec; color: var(--holly); }
button.pill.no { background: #fff4d6; color: #7a5600; }
button.pill:hover { filter: brightness(.95); }
.addrow .check.full { flex-basis: 100%; font-weight: 600; }

@media (max-width: 600px) {
  .lights i:nth-child(n+13) { display: none; }
  svg.tree .lbl { font-size: 17px; stroke-width: 4.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .snow, .snow::before, .snow::after, .lights i, .drawn,
  svg.tree .orn, svg.tree .halo, svg.tree .bulb, svg.tree .bglow, svg.tree .starglow, svg.tree .chug, svg.tree .smoke circle, .scroll .seal, .scroll .parch.body { animation: none; }
}

footer .ver { opacity: .7; font-size: 13px; }
