header { position: relative; height: 390px; overflow: hidden; background: #122c50 url(/art/sky.webp) 50% 0 / auto 860px; box-shadow: 0 3px 0 var(--cream), 0 6px 0 var(--board), 0 12px 0 var(--red-deep), 0 18px 18px #04140f; }
header h1 { position: absolute; z-index: 2; inset: 86px 16px auto; text-align: center; font-size: clamp(2.25rem, 9vw, 3.5rem); color: #ffe3a0; text-shadow: 0 -2px 0 var(--board), 0 3px 0 #0a1626, 0 8px 14px #0a1626; }
.bench { position: absolute; inset: auto 0 0; height: 250px; perspective: 900px; }
.pop { position: absolute; bottom: 26px; left: 50%; transform-origin: 50% 100%; }
.puppet { --u: 3.6px; width: 146px; height: 214px; margin-left: -72px; transform-style: preserve-3d; }
.drift { position: absolute; inset: auto 0 0; height: 50px; background: url(/art/drift.webp) 50% 0 / 1100px 76px; }

/* Over the garland: the site name, the account and the language, as paper chips. */
.bar { position: absolute; z-index: 25; inset: 10px 12px auto; display: flex; gap: 8px; align-items: center; }
.bar .home, .account { min-height: 40px; padding: 4px 12px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--cream); border-radius: 8px; box-shadow: var(--lift); }
.bar .home { margin-right: auto; white-space: nowrap; }
.bar .home::before { content: ''; width: 22px; height: 22px; background: url(/art/star.webp) 50% 50% / contain no-repeat; }
.bar .language { order: 1; }
.account { order: 2; padding-left: 6px; font-size: .9375rem; }
.account[hidden] { display: none; }
/* The organizer's initial on a red paper disc, then the address and the way out. */
.account::before { content: attr(data-initial); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--cream); background: #c4272d; box-shadow: inset 0 0 0 2px #fff3dc; font: 700 .9375rem/1 Sansita, serif; text-transform: uppercase; }
.account .quiet { min-height: 32px; padding: 2px 0 2px 10px; white-space: nowrap; border-left: 2px dotted #c9a987; border-radius: 0; }
.who { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a phone the address and the language's name would push the title down; the initial and the flag are enough. */
@media (max-width: 640px) { .who, .bar .language-name { display: none; } .bar .home { padding-right: 10px; } }
/* Narrower still: the star alone stands for the site's name (still read out by screen readers). */
@media (max-width: 460px) { .bar .home { font-size: 0; gap: 0; padding: 4px 9px; } }
.note { color: #14583f; font-weight: 700; }
.note:empty { display: none; }

main { position: relative; z-index: 31; display: grid; gap: 112px; width: min(100% - 12px, 640px); margin: 0 auto; padding: 128px 0 64px; }
/* The three stages, as paper tags hung on a string. */
.steps { position: relative; justify-self: center; width: min(100%, 440px); aspect-ratio: 404 / 250; margin: 0 0 -40px; padding: 0; list-style: none; display: block; background: url(/art/fireplace.webp) 50% 0 / 100% auto no-repeat; }
.steps li { position: absolute; top: 14.5%; width: 23%; display: grid; justify-items: center; padding: 0; border: 0; }
.steps li:nth-child(1) { left: 8%; }
.steps li:nth-child(2) { left: 38.5%; }
.steps li:nth-child(3) { left: 69%; }
.sock { position: relative; display: block; width: 100%; transform-origin: 50% 3%; }
.sock .stocking { position: relative; z-index: 1; display: block; width: calc(100% * 128 / 112); margin: calc(-100% * 8 / 112) 0 calc(-100% * 8 / 112) calc(-100% * 8 / 112); filter: saturate(.55) brightness(.92); transition: filter .4s; }
.sock .treats { position: absolute; z-index: 0; left: 8%; top: -24%; width: calc(84% * 124 / 108); margin: calc(-84% * 8 / 108) 0 0 calc(-84% * 8 / 108); opacity: 0; translate: 0 45%; transition: translate .6s cubic-bezier(.3,1.45,.5,1), opacity .3s; }
.steps .done .stocking, .steps [aria-current] .stocking { filter: none; }
.steps .done .treats, .steps [aria-current]:last-child .treats { opacity: 1; translate: 0 0; }
.steps [aria-current] .sock { animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@media (prefers-reduced-motion: reduce) { .steps [aria-current] .sock { animation: none; } }
/* The stage's name on a little paper tag tied below the stocking. */
.steps .tag { position: relative; z-index: 2; margin-top: -8px; padding: 4px 9px; white-space: nowrap; text-align: center; font-weight: 700; font-size: .9375rem; line-height: 1.15; color: var(--ink); background: radial-gradient(circle at 50% 5px, #7c5a2c 2px, #0000 2.5px), #fdf1d8; border-radius: 4px; box-shadow: var(--lift); rotate: -3deg; }
.steps li:nth-child(2) .tag { rotate: 2deg; }
.steps [aria-current] .tag { color: var(--cream); background: radial-gradient(circle at 50% 5px, #5d0d15 2px, #0000 2.5px), #c4272d; }
.steps .done .tag::after { content: ' ✓'; color: #14583f; }
.closed { justify-self: center; rotate: -2deg; padding: 10px 16px; text-align: center; font-weight: 700; color: var(--red-deep); border: 3px double var(--red-deep); border-radius: 6px; }
.card { display: grid; gap: 14px; }
.card > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row input, .row select { flex: 1 1 130px; width: auto; min-width: 0; }
.error, .hint { color: var(--red-deep); font-weight: 700; }
.error:empty, .hint:empty { display: none; }
ul { list-style: none; margin: 0; padding: 0; display: grid; }
li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; border-top: 2px dotted #c9a987; padding: 8px 0; }
li .name { flex: 1 1 120px; width: auto; min-width: 0; background: none; box-shadow: none; font-weight: 700; font-size: 1.25rem; padding-left: 4px; }
li .name:hover { box-shadow: inset 0 0 0 1.5px #c9a987; }
li .name:focus { background: #fffdf6; }
.links li { padding: 14px 0; }
.links .state { color: var(--soft); }
.links .state.yes { color: #14583f; font-weight: 700; }
.links .buttons { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.action { margin-top: -50px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.big { font: 700 1.75rem/1.1 Sansita, serif; padding: 18px 34px; }
.hint { color: #ffe3a0; }
.reset, .reopen { justify-self: start; }
dialog.card { position: fixed; margin: auto; overflow: visible; width: min(100% - 32px, 440px); color: inherit; }
dialog:not([open]) { display: none; }
dialog::backdrop { background: #04140fd0; }
dialog form { display: flex; flex-wrap: wrap; gap: 8px; }

/* Names go into the sack, sealed envelopes come out. */
.lottery { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--pine) url(/art/wrap.webp) 50% 0 / 200px; }
body:has(.lottery) #snow { z-index: 60; }
.lottery > * { position: absolute; left: 50%; top: 58%; }
.lottery .bag { width: 240px; margin: -110px 0 0 -120px; transform-origin: 50% 90%; }
.lottery .slip { padding: 8px 16px; translate: -50% -50%; background: var(--cream); border-radius: 2px; box-shadow: var(--cut); font: 400 1.5rem/1 Caveat, cursive; white-space: nowrap; }
.lottery .letter { width: 96px; margin: -34px 0 0 -48px; }
.lottery p { z-index: 1; top: 9%; width: 100%; left: 0; text-align: center; font: 700 2rem/1.1 Sansita, serif; color: #ffe3a0; }

/* Sign-in */
.robot:empty { display: none; }
.sent .button, .sent .quiet { justify-self: start; }

/* The list of groups: each one a link to its workshop. */
.groups li { padding: 10px 0; }
.group-link { flex: 1 1 200px; display: grid; gap: 2px; color: var(--ink); text-decoration: none; }
.group-link strong { font: 700 1.375rem/1.2 Sansita, serif; color: var(--red-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.group-link small { color: var(--soft); font-size: 1rem; }
.empty { color: var(--soft); }

/* One group */
.crumbs { margin-bottom: -70px; }
.crumbs a { color: #ffe3a0; font-weight: 700; }
.crumbs a::before { content: '← '; }
.you { padding: 1px 8px; font-size: .875rem; font-weight: 700; color: var(--cream); background: #1d6a50; border-radius: 10px; }
li .reach { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px 8px; }
li .reach input { flex: 1 1 180px; width: auto; min-width: 0; min-height: 40px; padding: 6px 10px; font-size: 1rem; }
.people .join-open { justify-self: start; }
.past { padding: 8px 12px; font-weight: 700; color: #0c3a2c; background: #dcebd9; border-radius: 4px; }
.emailed { flex: 1 0 100%; color: #14583f; }
.send-all { justify-self: start; }
.event select { width: auto; }
.card ~ .delete { margin-top: -60px; justify-self: center; color: #ffdf94; }
dialog [name=answer] { margin-bottom: 12px; }

/* The public sign-up link: the QR code pinned on the card like a paper tag, the link and the ways to send it. */
.qr-frame { justify-self: center; margin: 4px 0; padding: 12px; background: var(--cream); border-radius: 4px; box-shadow: var(--lift); rotate: -1.5deg; }
.qr-frame img { display: block; width: min(220px, 60vw); height: auto; image-rendering: pixelated; }
.share-link { font-size: 1rem; text-overflow: ellipsis; }
.share .buttons { gap: 8px 10px; }
.share .renew { justify-self: start; }

/* The sign-up page */
.signup .facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.signup .facts:empty { display: none; }
.signup dt { font-weight: 700; color: var(--soft); }
.signup dd { margin: 0; font-weight: 700; }
.signup .message { padding: 10px 14px; font: 400 1.5rem/1.25 Caveat, cursive; background: #fffdf6; border-left: 4px solid var(--red); rotate: -.6deg; }
.signup .count { color: #14583f; font-weight: 700; }
.signup .small { margin: -6px 0 0; font-size: .9375rem; color: var(--soft); }
.signup .big { justify-self: center; }
.signup .done .row { gap: 8px 10px; }
.closed-card { text-align: center; }

/* Each group: its year on a red tag, the name, when, and its state as a coloured paper label. */
.groups li.group { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 6px 14px; padding: 14px 0; }
.groups li.group > .quiet { grid-column: 2; justify-self: start; min-height: 36px; padding: 2px 0; }
.year { margin-top: 2px; padding: 6px 8px 5px; font: 700 1rem/1 Sansita, serif; color: var(--cream); background: #c4272d; border-radius: 4px; box-shadow: inset 0 0 0 1.5px #fff3dc, 0 2px 0 #85131d; rotate: -4deg; }
.group-link { display: grid; gap: 4px; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: .9375rem; color: var(--soft); }
.status b { padding: 2px 10px; border-radius: 999px; font-size: .875rem; color: #fffdf6; background: #1d6a50; box-shadow: inset 0 0 0 1.5px #fff3dc; }
.group.ready .status b { color: var(--ink); background: #f0b441; }
.group.drawn .status b { background: #c4272d; }
.group.done .status b { color: var(--ink); background: #d9c6a3; }
.group.done .year { background: #8c7a63; box-shadow: inset 0 0 0 1.5px #fff3dc, 0 2px 0 #5e4f3e; }
.group.done .group-link strong { color: var(--soft); }

/* The sign-up fields as a letter to Santa: stitched paper, a stamp, a picture by each line, and handwriting on dotted lines. */
.letterbox { position: relative; display: grid; gap: 16px; padding: 18px 18px 20px; background: #fffdf6; border: 2px dashed #d9b98c; border-radius: 10px; box-shadow: 0 2px 0 #e9d6b4; }
.letterbox .post { position: absolute; top: -18px; right: 12px; width: 48px; rotate: 8deg; }
.field { display: grid; grid-template-columns: 42px 1fr; align-items: end; gap: 0 12px; }
.field img { grid-row: span 2; align-self: center; width: 40px; rotate: -6deg; }
.field:nth-of-type(2) img { rotate: 5deg; }
.field span { font-weight: 700; font-size: .9375rem; color: var(--soft); }
.field input { min-height: 44px; padding: 0 6px; font: 400 1.75rem/1.2 Caveat, cursive; color: #1d3f72; background: none; border-radius: 0; box-shadow: none; border-bottom: 2px dashed #c9a987; transition: border-color .2s, background-color .2s; }
.field input:focus { outline: none; border-bottom: 2px solid var(--red); background: #fff6e3; }
.field input:focus-visible { box-shadow: 0 2px 0 var(--red); }

/* Many people at once */
.people .bulk-open { justify-self: start; }
.bulk { display: grid; gap: 10px; }
.bulk label { display: grid; gap: 6px; color: var(--soft); }
.bulk textarea { min-height: 130px; resize: vertical; }
.bulk .note { white-space: pre-line; }
