:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172f25;
  background: #102b24;
  --paper: #faf3e4;
  --forest: #133c2c;
  --red: #aa3026;
  --gold: #e5bc6b;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .3em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #a83528; outline-offset: 4px; }
.masthead :focus-visible, .footer :focus-visible { outline-color: var(--gold); }

.site { width: 100%; max-width: 510px; padding: 22px 16px; margin-inline: auto; }
.masthead, .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #e7ddc7;
  font-size: .875rem;
}
.masthead { padding: 0 2px 17px; }
.footer { align-items: start; padding: 16px 2px 0; color: #c8c7b2; }
.event-info summary { cursor: pointer; width: fit-content; }
.event-info p { max-width: 36ch; margin: 9px 0 0; line-height: 1.5; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff4dd;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: .19em;
}
.brand-mark { color: var(--gold); font-size: 1.5rem; line-height: 1; }
.masthead-note { color: #e7c589; font: italic .95rem Georgia, serif; }

.exchange {
  background: var(--paper);
  border: 1px solid #cbb688;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 70px #071a15a0;
}
.scene {
  height: clamp(170px, 43vw, 214px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(125deg, #fff5d204 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 49% 50%, #2e5b3d, #193b2d 60%, #102d24 94%);
}
.scene-frame {
  position: absolute;
  inset: 9px;
  border: 1px solid #d7af644a;
  border-radius: 9px 9px 2px 2px;
  pointer-events: none;
}
.scene-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #d7af6422;
  border-radius: inherit;
}
.scene-ring {
  position: absolute;
  width: min(52%, 215px);
  aspect-ratio: 1;
  border: 1px solid #e9d89b32;
  border-radius: 50%;
  box-shadow: 0 0 0 9px #ecd5970b, 0 0 0 19px #ecd59709, inset 0 0 58px #bdb36714;
}
.snow { position: absolute; inset: 0; pointer-events: none; }
.snow i {
  position: absolute;
  color: #efd59a;
  line-height: 1;
  font: normal 1.45rem Georgia, serif;
  animation: glimmer 4.5s ease-in-out infinite alternate;
}
.snow i:nth-child(1) { top: 19%; left: 16%; }
.snow i:nth-child(2) { top: 14%; left: 77%; font-size: 1rem; animation-delay: -3s; }
.snow i:nth-child(3) { top: 40%; left: 12%; font-size: 1rem; animation-delay: -1s; }
.snow i:nth-child(4) { top: 29%; left: 81%; font-size: 2rem; animation-delay: -2s; }
.snow i:nth-child(5) { top: 64%; left: 14%; font-size: .8rem; animation-delay: -2s; }
.snow i:nth-child(6) { top: 75%; left: 24%; animation-delay: -3s; }
.snow i:nth-child(7) { top: 68%; left: 84%; animation-delay: -1s; }
.snow i:nth-child(8) { top: 80%; left: 77%; font-size: .8rem; }
.snow i:nth-child(9) { top: 10%; left: 51%; font-size: .7rem; animation-delay: -1s; }

.parcel { position: relative; width: clamp(110px, 32%, 170px); aspect-ratio: 1.06; transform: rotate(-9deg); }
.parcel-shadow {
  position: absolute;
  width: 100%;
  height: 19%;
  left: 6%;
  bottom: -2%;
  background: #071e16b8;
  filter: blur(18px);
  border-radius: 50%;
}
.parcel-box, .parcel-lid {
  position: absolute;
  background:
    linear-gradient(90deg, transparent 40%, #e1aa53 40% 60%, transparent 60%),
    repeating-linear-gradient(145deg, #ffb1793d 0 1px, transparent 1px 13px),
    linear-gradient(140deg, #c45a48, #a7312b 65%, #812620);
  border: 1px solid #f5c28d7a;
}
.parcel-box {
  inset: 30% 6% 5%;
  border-radius: 5px 5px 13px 13px;
  box-shadow: inset -10px -12px 0 #61191933, 7px 18px 26px #081c1580;
}
.parcel-lid {
  inset: 21% 0 auto;
  height: 20%;
  border-radius: 8px;
  box-shadow: 0 7px 8px #60251d7a, inset 0 2px 0 #f7b97a99;
  transition: transform .65s cubic-bezier(.2,.8,.2,1);
}
.bow { position: absolute; width: 52%; height: 122%; left: 24%; bottom: 95%; }
.bow i {
  position: absolute;
  bottom: 3%;
  width: 50%;
  height: 80%;
  border: 5px solid #dfb15c;
  border-radius: 75% 64% 14% 65%;
  transform: rotate(20deg);
  box-shadow: inset 0 0 3px #7d4b24, 0 2px 1px #72461f;
}
.bow i:nth-child(2) { right: 0; transform: scaleX(-1) rotate(20deg); }
.bow b {
  position: absolute;
  left: 41%;
  bottom: -4%;
  width: 19%;
  aspect-ratio: 1;
  border: 1px solid #f9dd8f;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f9d786, #bf8738);
}
[data-stage="reveal"] .parcel { animation: float 3.6s ease-in-out infinite; }
[data-stage="result"] .parcel-lid { transform: translate(-12%, -97%) rotate(-14deg); }
[data-stage="result"] .snow i { animation: sparkle .65s ease-out both; }
[data-stage="result"] .snow i:nth-child(even) { animation-delay: .12s; }

.flow { min-height: 355px; padding: 25px clamp(18px, 6.4vw, 38px) 30px; }
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: .42rem; align-items: center; color: #605f50; font-size: .875rem; font-weight: 600; }
.steps li span { width: .5rem; height: .5rem; border: 1px solid #7d8475; border-radius: 50%; }
.steps li[aria-current] { color: var(--red); }
.steps li[aria-current] span { background: var(--red); border-color: var(--red); }
.steps li.done span { background: #3e684e; border-color: #3e684e; }
.screens { padding-top: 32px; }
.screen { animation: enter .32s ease-out both; }
h1 {
  margin: 0 0 17px;
  font: 700 clamp(2.65rem, 11vw, 4.2rem)/.92 Georgia, "Times New Roman", serif;
  letter-spacing: -.075em;
  overflow-wrap: anywhere;
}
h1:focus { outline: none; }
.period { color: var(--red); }
.intro { color: #454b40; font-size: 1.05rem; line-height: 1.55; margin: 0 0 19px; }
.intro strong { color: #263e2e; }
.picker-help { color: #454b40; font-size: .875rem; line-height: 1.45; margin: 13px 0 0; }
label { display: block; font-size: .875rem; font-weight: 710; margin-bottom: 8px; }
input, select, textarea {
  display: block;
  width: 100%;
  color: #183426;
  background: #fffbf2;
  border: 1px solid #9a9a80;
  border-radius: 9px;
  padding: 12px 13px;
}
input, select { min-height: 52px; }
textarea { resize: vertical; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 20px;
  width: 8px;
  height: 8px;
  border: solid #566747;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
select { appearance: none; padding-right: 40px; }
.screen button, .admin-card form button { margin-top: 12px; }
button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 11px 14px;
  background: var(--forest);
  border: 1px solid transparent;
  border-radius: 9px;
  color: #fff8e7;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
button:hover:not(:disabled) { background: #225740; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .59; cursor: default; }
.text-button {
  background: transparent;
  color: #3c493a;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .25em;
  min-height: 44px;
}
.text-button:hover:not(:disabled) { background: #eae2cc; }
.retry { margin-top: 4px; }
.result-label { color: var(--red); font-weight: 750; margin: 0 0 12px; }
.gift-prep { border-top: 1px solid #d9cdb4; margin-top: 20px; padding-top: 15px; }
.gift-prep h2 { font-size: .95rem; margin: 0 0 6px; }
.gift-prep ul { font-size: .95rem; line-height: 1.45; margin: 0; padding-left: 19px; }
.gift-prep li + li { margin-top: 4px; }
.message, .notice { margin: 15px 0 0; line-height: 1.4; font-size: .925rem; }
.message { color: #9a251d; }
.notice { color: #2b5941; }

.admin-site { max-width: 720px; }
.admin-card { background: var(--paper); padding: clamp(24px, 6vw, 52px); border-radius: 20px; }
.admin-card h1 { font-size: clamp(3rem, 9vw, 5rem); margin-bottom: 28px; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-names { margin-top: 20px; }
.add-names summary { cursor: pointer; width: fit-content; font-weight: 700; }
.add-names form { margin-top: 12px; }
.roster { list-style: none; margin: 23px 0 0; padding: 0; }
.roster li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; border-top: 1px solid #d9cdb4; }
.roster li > div { min-width: 0; overflow-wrap: anywhere; }
.roster small { display: block; color: #4b574a; font-size: .875rem; margin-top: 3px; }
.roster-actions { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }
.roster-actions .text-button { padding-inline: 8px; }
.roster button { width: auto; flex-shrink: 0; }

@keyframes glimmer { from { opacity: .5; transform: scale(.88); } to { opacity: 1; transform: scale(1.1); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-9deg); } 50% { transform: translateY(-8px) rotate(-6deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sparkle { 0% { opacity: .5; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.65); } 100% { opacity: 1; transform: scale(1); } }

@media (max-width: 340px) {
  .masthead-note { display: none; }
  .steps { column-gap: .55rem; }
  .steps li { gap: .25rem; }
}

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