/* ===== Lagniappe Santa ===== */
:root {
    --red: #c8323f;
    --red-dark: #9c1f2c;
    --green: #1f6b4a;
    --green-dark: #123d2c;
    --night: #0d2e22;
    --gold: #f2c14e;
    --gold-dark: #c99a2e;
    --cream: #fff9f0;
    --paper: #ffffff;
    --ink: #2d2226;
    --muted: #7b6b70;
    --line: #efe3d6;
    --sky: #eef5fb;
    --sky-deep: #dce9f5;
    --radius: 18px;
    --shadow: 0 8px 24px rgba(40, 70, 110, .12);
    --font-display: "Lilita One", "Fredoka", system-ui, sans-serif;
    --font-head: "Fredoka", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 105%, rgba(200,50,63,.07), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(31,107,74,.08), transparent 40%),
        linear-gradient(180deg, #f8fbfe 0%, var(--sky) 45%, var(--sky-deep) 100%);
    background-color: var(--sky);
    background-attachment: fixed;
}

#snow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

a { color: var(--red); }
a:hover { color: var(--red-dark); }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.inline { display: inline; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    color: var(--red);
    text-shadow: 0 3px 0 rgba(200,50,63,.15);
    letter-spacing: .5px;
}

/* ----- Header ----- */
.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: .9rem clamp(1rem, 4vw, 2rem);
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    box-shadow: 0 2px 0 rgba(0,0,0,.15);
}

.brand {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.9rem;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 2px 0 rgba(0,0,0,.25);
    white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-star { color: var(--gold); margin-right: .35rem; display: inline-block; animation: twinkle 3s ease-in-out infinite; }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.nav-link {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 500;
    padding: .4rem .8rem;
    border-radius: 999px;
    transition: background .15s;
}
.nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-admin { background: rgba(242,193,78,.25); }
.nav-button { background: none; border: 1px solid rgba(255,255,255,.5); font-size: 1rem; cursor: pointer; }

/* Christmas lights string under the header */
.lights {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-around;
    height: 22px;
    margin-top: -2px;
    overflow: hidden;
    background: radial-gradient(ellipse 60% 14px at 50% -6px, #2a2a2a 50%, transparent 52%) repeat-x;
    background-size: calc(100% / 24) 22px;
}
.lights span {
    width: 10px;
    height: 16px;
    margin-top: 4px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: glow 2.4s ease-in-out infinite;
}
.lights span:nth-child(4n+1) { background: #ff4d5e; color: #ff4d5e; }
.lights span:nth-child(4n+2) { background: var(--gold); color: var(--gold); animation-delay: .6s; }
.lights span:nth-child(4n+3) { background: #4ade80; color: #4ade80; animation-delay: 1.2s; }
.lights span:nth-child(4n+4) { background: #60a5fa; color: #60a5fa; animation-delay: 1.8s; }
@media (max-width: 600px) { .lights span:nth-child(n+13) { display: none; } }

@keyframes glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px 2px currentColor; }
    50% { opacity: .45; box-shadow: none; }
}
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.2) rotate(20deg); } }

/* ----- Layout ----- */
.container {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
}

.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    padding: 1rem;
}

.page-title { color: var(--ink); margin: .5rem 0 1rem; }
.page-title .display { font-size: clamp(2.2rem, 6vw, 3rem); }
.page-sub { color: var(--muted); margin-top: -.5rem; }
.back-link { color: var(--green); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--green-dark); text-decoration: underline; }

/* ----- Cards ----- */
.card {
    position: relative;
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.card.candy::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    background: repeating-linear-gradient(-45deg, var(--red) 0 12px, #fff 12px 24px);
}
.card.candy { padding-top: 1.9rem; }
.card.cream { background: var(--cream); }
.card h2 { color: var(--green-dark); }

.tag-card {
    max-width: 520px;
    margin: 2rem auto 0;
    text-align: center;
    border: 2px dashed var(--gold);
    background: var(--cream);
}
.tag-card::after {
    content: "";
    position: absolute;
    top: 14px; left: 50%;
    width: 16px; height: 16px;
    margin-left: -8px;
    border-radius: 50%;
    background: var(--sky);
    box-shadow: inset 0 0 0 3px var(--gold);
}
.tag-card h2 { margin-top: 1.2rem; }

.grid-2 { display: grid; gap: 1.25rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 > .card { margin-bottom: 0; }

/* ----- Hero (landing) ----- */
.hero { text-align: center; color: var(--ink); padding: 2rem 0 1rem; }
.hero .lead { font-size: 1.2rem; max-width: 560px; margin: 0 auto 1rem; color: #4f4347; }
.hero .card { color: var(--ink); }
.hero-emoji { font-size: 4rem; }
.hero-gifts { font-size: 3rem; margin-bottom: .5rem; }
.gift { display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.gift.g2 { font-size: 4rem; animation-delay: .3s; }
.gift.g3 { animation-delay: .6s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    padding: .75rem 1.25rem;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .1s, box-shadow .15s, background .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark); }
.btn-primary:hover { background: #d93d4a; color: #fff; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.btn-green:hover { background: #25805a; color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-dark); }
.btn-gold:hover { background: #f6cd6a; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--green-dark); border-color: var(--line); }
.btn-ghost:hover { background: var(--cream); color: var(--green-dark); }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger-ghost:hover { background: #fdecee; color: var(--red-dark); }
.btn-sm { padding: .45rem .8rem; font-size: .9rem; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.15rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ----- Forms ----- */
label { display: block; font-weight: 700; margin-bottom: .3rem; color: var(--green-dark); }
.field { margin-bottom: 1rem; }
.input, textarea.input, select.input {
    width: 100%;
    font: inherit;
    padding: .7rem .9rem;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(31,107,74,.15); }
textarea.input { min-height: 90px; resize: vertical; }
.hint { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.field-error, .validation-summary-errors { color: var(--red); font-size: .9rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.2rem; }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ----- Flash messages ----- */
.flash {
    padding: .9rem 1.2rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: drop .35s ease-out;
}
.flash-success { background: #e8f6ee; color: var(--green-dark); border-left: 6px solid var(--green); }
.flash-error { background: #fdecee; color: var(--red-dark); border-left: 6px solid var(--red); }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }

.nudge {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--gold);
    color: var(--ink);
    text-decoration: none;
    padding: .9rem 1.2rem;
    border-radius: 14px;
    font-weight: 700;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 0 var(--gold-dark);
}
.nudge:hover { color: var(--ink); background: #f6cd6a; }
.nudge .arrow { margin-left: auto; }

/* ----- Badges / pills ----- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    background: var(--cream);
    color: var(--green-dark);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.pill-red { background: #fdecee; color: var(--red-dark); border-color: #f7cdd2; }
.pill-green { background: #e8f6ee; color: var(--green-dark); border-color: #bfe5cf; }
.pill-gold { background: #fdf3d8; color: #7a5a10; border-color: #f3dc9c; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ----- Wish list ----- */
.wish-list { list-style: none; margin: 0; padding: 0; }
.wish-list li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px dashed var(--line);
}
.wish-list li:last-child { border-bottom: 0; }
.wish-list .bullet { flex: none; font-size: 1.2rem; line-height: 1.4; }
.wish-list .item { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wish-list .item p { margin: 0; }
.wish-list .item p:empty, .wish-list .item br + br { display: none; }
.wish-list .item a { font-weight: 700; }
.wish-list li form { flex: none; }
.empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: .3rem; }

/* ----- Gift reveal ----- */
.reveal { text-align: center; padding: 1rem 0 .5rem; }
.present {
    position: relative;
    width: 170px;
    height: 150px;
    margin: 1.5rem auto 1rem;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    display: block;
}
.present:focus-visible { outline: 3px dashed var(--gold); outline-offset: 8px; border-radius: 8px; }
.present .box, .present .lid {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--red);
    background-image:
        linear-gradient(90deg, transparent 43%, var(--gold) 43% 57%, transparent 57%);
    border-radius: 6px;
}
.present .box { bottom: 0; width: 150px; height: 105px; box-shadow: inset 0 -10px 0 rgba(0,0,0,.12); }
.present .lid {
    bottom: 100px;
    width: 170px;
    height: 32px;
    background-color: var(--red-dark);
    transition: transform .6s cubic-bezier(.5,-0.5,.5,1.5), opacity .6s;
    z-index: 2;
}
.present .bow {
    position: absolute;
    left: 50%;
    top: -26px;
    width: 60px;
    height: 30px;
    margin-left: -30px;
}
.present .bow::before, .present .bow::after {
    content: "";
    position: absolute;
    top: 0;
    width: 30px;
    height: 28px;
    border: 7px solid var(--gold);
    border-radius: 50% 50% 0 50%;
}
.present .bow::before { left: -2px; transform: rotate(-15deg); }
.present .bow::after { right: -2px; border-radius: 50% 50% 50% 0; transform: rotate(15deg); }
.present:not(.opened) { animation: wiggle 2.2s ease-in-out infinite; }
.present:hover:not(.opened) { animation-duration: .6s; }
.present.opened { animation: none; pointer-events: none; }
.present.opened .lid { transform: translate(-20%, -110px) rotate(35deg); opacity: 0; }
.present.opened .box { animation: poof .45s .25s ease-in forwards; }
.reveal.opened .present { display: none; }
@keyframes poof {
    40% { transform: translateX(-50%) scale(1.12); opacity: 1; }
    100% { transform: translateX(-50%) scale(.2); opacity: 0; }
}

/* Gift tag shown once the present is unwrapped */
.gift-tag {
    --hole: 2.6rem;
    position: relative;
    display: inline-block;
    min-width: min(320px, 100%);
    max-width: 100%;
    margin: 1.6rem auto 1rem;
    padding: 1.1rem 2rem 1.1rem calc(var(--hole) + 1.2rem);
    background: linear-gradient(135deg, #fff7df, #fdecc0);
    color: var(--ink);
    text-align: left;
    clip-path: polygon(var(--hole) 0, 100% 0, 100% 100%, var(--hole) 100%, 0 50%);
    filter: drop-shadow(0 6px 10px rgba(40,70,110,.18));
    transform-origin: 0 50%;
    animation: swing 2.8s ease-in-out .6s infinite;
}
.gift-tag::before {
    /* the tag's hole */
    content: "";
    position: absolute;
    left: calc(var(--hole) * .45);
    top: 50%;
    width: 16px; height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: inset 0 0 0 3px var(--gold-dark);
}
.gift-tag::after {
    /* dashed stitching inside the edge */
    content: "";
    position: absolute;
    inset: 7px 7px 7px calc(var(--hole) + 2px);
    border: 2px dashed rgba(201,154,46,.6);
    border-radius: 8px;
    pointer-events: none;
}
.gift-tag .tag-label {
    display: block;
    font-family: var(--font-head);
    font-size: .95rem;
    color: var(--muted);
}
.gift-tag .tag-label em { font-style: normal; color: var(--green); font-weight: 600; }
@keyframes swing {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}
@keyframes wiggle {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(-5deg); }
    85% { transform: rotate(5deg); }
    95% { transform: rotate(-3deg); }
}

.reveal-name {
    display: none;
    animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both;
}
.reveal.opened .reveal-name { display: block; }
.reveal.opened .tap-hint { display: none; }
.reveal-name .who {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 8vw, 3rem);
    color: var(--red);
    line-height: 1.1;
    margin: .1rem 0 .3rem;
}
.tap-hint { font-family: var(--font-head); color: var(--muted); }
.after-reveal { display: none; }
.after-reveal.show { display: block; animation: drop .5s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ----- Admin ----- */
.table-wrap { overflow-x: auto; margin: 0 -1.5rem; padding: 0 1.5rem; }
table.people { width: 100%; border-collapse: collapse; }
table.people th {
    text-align: left;
    font-family: var(--font-head);
    font-weight: 500;
    color: var(--muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .5rem;
    border-bottom: 2px solid var(--line);
}
table.people td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.people tr:last-child td { border-bottom: 0; }
table.people .name { font-weight: 700; }
table.people .actions { text-align: right; white-space: nowrap; }
.contact { font-size: .85rem; color: var(--muted); }

.exchange-list { list-style: none; margin: 0; padding: 0; }
.exchange-list li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .9rem 1rem;
    margin: 0 -1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
}
.exchange-list li a:hover { background: var(--cream); }
.exchange-list .year { font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: var(--red); min-width: 4.5rem; }
.exchange-list .meta { flex: 1; }

.stat-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; color: var(--green-dark); line-height: 1; }
.stat .lbl { font-size: .85rem; color: var(--muted); }

.check-list { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 1.5rem; }
.check-list li { break-inside: avoid; }

/* Toggle switch (checkbox) */
.toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem .2rem;
    border-bottom: 1px dashed var(--line);
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track {
    flex: none;
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: #e5d6d9;
    transition: background .2s;
}
.toggle .track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform .2s;
}
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(22px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 2px; }
.toggle .state { font-size: .8rem; font-weight: 700; min-width: 4.5rem; text-align: right; color: var(--red); }
.toggle input:checked ~ .state { color: var(--green); }

details.spoiler summary { cursor: pointer; font-weight: 700; color: var(--red); }
details.spoiler ul { columns: 2 240px; margin: .8rem 0 0; padding-left: 1.2rem; }

.copy-link.copied { background: var(--green); color: #fff; border-color: var(--green); }

/* Confirm dialog */
dialog.confirm {
    border: 0;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 420px;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow);
}
dialog.confirm::backdrop { background: rgba(13,46,34,.6); backdrop-filter: blur(2px); }
dialog.confirm h2 { color: var(--red-dark); }

@media (max-width: 600px) {
    h1 { font-size: 1.7rem; }
    .card { padding: 1.2rem; }
    .card.candy { padding-top: 1.6rem; }
    .table-wrap { margin: 0 -1.2rem; padding: 0 1.2rem; }
    table.people .hide-sm, table.people thead { display: none; }
    table.people, table.people tbody, table.people tr, table.people td { display: block; }
    table.people tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
    table.people tr:last-child { border-bottom: 0; }
    table.people td { border: 0; padding: .15rem 0; }
    table.people .actions { text-align: left; white-space: normal; padding-top: .4rem; }
    .brand { font-size: 1.6rem; }
    .site-header { padding: .7rem .8rem; }
    .nav { gap: 0; margin-left: -.5rem; }
    .nav-link { padding: .35rem .55rem; font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
