@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;650;700;750&family=Fraunces:ital,opsz,wght@0,9..144,600;0,9..144,700;1,9..144,600&display=swap');

:root {
  color-scheme: light;
  --ink: #192b25;
  --muted: #52655d;
  --green: #124638;
  --forest: #092d25;
  --paper: #f8f6f0;
  --line: #e5e1d6;
  --red: #a9343c;
  --gold: #f4cb78;
  --serif: "Fraunces", Georgia, serif;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #b65638; outline-offset: 3px;
}
#main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); letter-spacing: -.045em; }
h2 { font-size: clamp(1.8rem, 4.6vw, 2.6rem); line-height: 1.12; }
.shell { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.top { background: #fffcf6; border-bottom: 1px solid var(--line); }
.top-inner { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.brand { display: inline-flex; gap: 10px; align-items: center; width: fit-content; text-decoration: none; font: 700 1.28rem var(--serif); letter-spacing: -.045em; white-space: nowrap; }
.brand-icon { display: block; height: 32px; width: 32px; border-radius: 9px; }
nav { display: flex; align-items: center; gap: 5px; }
nav a { text-decoration: none; color: var(--muted); white-space: nowrap; padding: 9px 13px; border-radius: 7px; font-size: .88rem; font-weight: 700; }
nav a[aria-current="page"], nav a:hover { color: var(--green); background: #eaf0e8; }
#account { justify-self: end; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #f0dfd6; color: #793c33; font-weight: 750; font-size: .77rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; min-height: 42px; border-radius: 8px; border: 1px solid transparent; text-decoration: none;
  font-weight: 750; font-size: .86rem; background: var(--green); color: white; line-height: 1.25;
}
.btn:hover { filter: brightness(1.10); }
.btn.light { background: #fffcf7; border-color: #deddd3; color: var(--green); }
.btn.quiet { background: transparent; color: var(--green); }
.btn.gold { background: var(--gold); color: #232a1b; }
.btn.danger { background: var(--red); }
main { min-height: calc(100vh - 154px); padding-top: 30px; padding-bottom: 50px; }
.hero {
  isolation: isolate; position: relative; overflow: hidden;
  min-height: 303px; display: flex; align-items: center; padding: 39px 47px; border-radius: 17px;
  color: #fff6e2; background: radial-gradient(ellipse at 82% 65%, #1d5541 0, var(--forest) 66%);
}
.hero::before { content: ""; inset: 0; position: absolute; z-index: -1; opacity: .62;
  background-image: radial-gradient(circle, #e4c37768 1px, transparent 1.4px), radial-gradient(circle, #fce8a730 1px, transparent 1.5px);
  background-size: 43px 53px, 67px 47px; background-position: 10px 7px, 24px 32px;
  mask-image: linear-gradient(90deg, transparent 10%, black 75%);
}
.hero-copy { z-index: 2; max-width: min(570px, 65%); }
.kicker { color: #8a5246; font-size: .74rem; letter-spacing: .13em; font-weight: 750; text-transform: uppercase; }
.hero .kicker { color: #f4ce83; display: flex; align-items: center; gap: 8px; }
.hero h1 { margin: 10px 0 11px; font-size: clamp(2.9rem, 6.25vw, 5.4rem); line-height: .98; }
.hero p { color: #e3ebe0; max-width: 390px; font-size: .98rem; line-height: 1.55; }
.hero .hero-welcome { font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-actions .quiet { color: #fff4dd; border-color: #ffffff66; }
.display { position: absolute; right: 3.5%; bottom: 20px; width: 36%; height: 255px; pointer-events: none; }
.display .sky-star { position: absolute; color: #f6d48f; font: 28px Georgia, serif; left: 6%; top: 20%; }
.display .sky-star:nth-child(2) { left: 82%; top: 12%; font-size: 37px; }
.display .sky-star:nth-child(3) { left: 49%; top: 1%; font-size: 22px; }
.display .sky-star:nth-child(4) { left: 93%; top: 52%; font-size: 19px; }
.display .scene { position: absolute; bottom: 18px; width: 100%; height: 190px; }
.display .scene::before { position: absolute; content: ""; bottom: 0; width: 100%; height: 33px; background: #061c1780; border-radius: 50%; filter: blur(5px); }
.display .parcel { position: absolute; bottom: 29px; left: 44%; scale: 1.62; transform: translateX(-50%) rotate(-9deg); z-index: 2; }
.display .parcel:nth-child(2) { left: 22%; bottom: 10px; scale: 1.03; transform: translateX(-50%) rotate(-10deg); z-index: 3; }
.display .parcel:nth-child(3) { left: 80%; bottom: 24px; scale: 1.38; transform: translateX(-50%) rotate(13deg); z-index: 1; }
.display .parcel:nth-child(4) { left: 68%; bottom: 12px; scale: .83; transform: translateX(-50%) rotate(7deg); z-index: 4; }

.statusbar { display: flex; padding: 15px 19px; min-height: 64px; align-items: center; gap: 13px; border: 1px solid #dddcd0; border-radius: 11px; background: #fffdf8; margin-top: 19px; }
.statusbar .mark { display: grid; place-items: center; height: 33px; width: 33px; flex: 0 0 33px; border-radius: 50%; background: #e9eee6; color: var(--green); }
.statusbar strong { display: block; font-size: .88rem; }
.statusbar p { color: var(--muted); margin-top: 2px; font-size: .82rem; line-height: 1.35; }
.statusbar .pill { margin-left: auto; }
.pill { display: inline-flex; gap: 6px; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 30px; background: #e8efe5; color: #205243; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.claimed { background: #eeeae1; color: #665d51; }
.pill.open { background: #f4e6c6; color: #664f20; }
.pill.mine { background: #134c38; color: #fff8e5; }
.gallery { margin-top: 37px; }
.gallery-heading { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 15px; }
.gallery-heading h2 { margin-top: 3px; }
.gallery-heading p { color: var(--muted); margin-top: 6px; font-size: .88rem; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: #f0ede6; }
.filters button { padding: 6px 9px; color: var(--muted); border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: .79rem; font-weight: 700; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: #fffdf8; color: var(--green); border-color: var(--line); box-shadow: 0 1px 2px #49443a12; }
.gift-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.gift-card { min-width: 0; background: #fffcf7; border: 1px solid var(--line); overflow: hidden; border-radius: 12px; }
.gift-card.interactive { box-shadow: 0 0 0 1px #789983; }
.gift-art { height: 144px; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--canvas); }
.gift-art::before { content: ""; position: absolute; inset: 0; opacity: .65; background-image: radial-gradient(#70634d36 1px, transparent 1px); background-size: 17px 17px; mask-image: radial-gradient(ellipse at center, transparent 16%, black); }
.gift-art::after { content: "✦"; position: absolute; top: 15%; right: 16%; color: #7c674f94; font: 16px Georgia, serif; }
.parcel { --bow-angle: 19deg; position: relative; width: var(--width); height: var(--height); margin-top: 14px; filter: drop-shadow(4px 8px 5px #231c1940); transform: rotate(var(--tilt,0deg)); }
.box { position: absolute; inset: 0; border-radius: 4px 4px 7px 7px; background-color: var(--wrap); background-image: var(--pattern); box-shadow: inset -8px 0 #21150f24, inset 0 -6px #21150f25; }
.square .box, .round .box { background-size: 13px 13px, 13px 13px; background-position: 0 0, 6px 6px; }
.square .box::before, .round .box::before { background-size: inherit; background-position: inherit; }
.box::before { content: ""; position: absolute; z-index: 1; inset: -2px -4px auto; height: 20%; min-height: 13px; background-color: inherit; background-image: inherit; border-radius: 4px; box-shadow: inset 0 3px #ffffff2b, 0 2px 0 #231a2440; }
.box::after { content: ""; position: absolute; inset: 0 0 0 calc(50% - 5px); height: 100%; width: 11px; z-index: 2; background: var(--ribbon); box-shadow: inset 2px 0 #ffffff40, inset -2px 0 #21150f29; }
.ribbon { position: absolute; left: 0; right: 0; top: 57%; height: 9px; z-index: 2; background: var(--ribbon); box-shadow: inset 0 2px #ffffff40, inset 0 -2px #21150f26; }
.bow { position: absolute; z-index: 3; top: -5px; left: 50%; transform: translateX(-50%); width: 12px; height: 10px; border-radius: 4px; background: var(--ribbon); box-shadow: inset -2px -2px #21150f30; }
.bow::before, .bow::after { content: ""; position: absolute; border: 4px solid var(--ribbon); width: 14px; height: 9px; top: -7px; border-radius: 60% 55% 48% 45%; box-shadow: 0 1px #21150f29; }
.bow::before { right: 7px; transform: rotate(var(--bow-angle)); }
.bow::after { left: 7px; transform: rotate(calc(-1 * var(--bow-angle))); }
.round .box { border-radius: 30% 30% 37% 37%; }
.round .box::before { border-radius: 50%; inset: -1px 0 auto; height: 24%; }
.round .ribbon { left: 2px; right: 2px; }
.round .box::after { border-radius: 0 0 3px 3px; }
.pouch .box { border-radius: 27% 27% 22% 22% / 42% 42% 22% 22%; }
.pouch .box::before { display: none; }
.pouch .ribbon { left: 1px; right: 1px; top: 39%; }
.pouch .bow { top: 0; }
.envelope .box { border-radius: 4px; }
.envelope .box::before { border-radius: 4px 4px 50% 50%; inset: 0; height: 32%; }
.gift-meta { padding: 11px 12px 12px; }
.gift-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.gift-title h3 { font-size: .95rem; font-weight: 750; }
.gift-meta > p { margin-top: 4px; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.gift-meta .btn { width: 100%; margin-top: 10px; }
.empty { padding: 29px 20px; background: #fffdf8; border: 1px dashed #d5d7ca; color: var(--muted); border-radius: 10px; }
footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 19px 0 22px; color: var(--muted); font-size: .76rem; }
footer span span { color: var(--green); }
.narrow { max-width: 720px; margin-inline: auto; }
.heading { margin: 10px 0 22px; }
.heading h1 { font-size: clamp(2.55rem, 8vw, 4.4rem); line-height: 1.02; margin-top: 5px; }
.heading p, .panel p { color: var(--muted); line-height: 1.55; margin-top: 7px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fffdf8; padding: 21px; margin-bottom: 14px; }
.panel h2 { font-size: 1.75rem; }
.panel .btn { margin-top: 12px; }
.field { display: block; font-weight: 750; font-size: .9rem; margin-top: 13px; }
.field small { display: block; font-weight: 500; color: var(--muted); margin-top: 3px; }
input:not([type="checkbox"]), textarea, select {
  display: block; width: 100%; margin-top: 5px; padding: 10px; border: 1px solid #c8ccc0; border-radius: 7px; background: #fff; color: var(--ink); font-size: 1rem;
}
textarea { resize: vertical; min-height: 112px; }
input[type="checkbox"] { accent-color: var(--green); width: 18px; height: 18px; flex: 0 0 18px; }
.consent { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; line-height: 1.45; margin-top: 14px; }
.consent input { margin: 2px 0 0; }
[hidden] { display: none !important; }
[data-photo="status"]:empty, .photo-options:empty { display: none; }
.photo-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.photo-choice { display: grid; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.photo-choice[aria-pressed="true"] { outline: 2px solid var(--green); }
.photo-choice canvas { border-radius: 3px; }
.photo-editor { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 12px; margin-top: 12px; }
.photo-editor canvas, .result-image { border: 1px solid var(--line); border-radius: 9px; max-width: 100%; max-height: 300px; }
.result-image { display: block; margin-top: 14px; }
.photo-editor .field:first-child { margin-top: 0; }
.photo-editor input[type="range"] { padding: 0; border: 0; accent-color: var(--green); }
.checklist .delivery-request { flex-wrap: wrap; }
.delivery-request .btn { margin: 0; }
@media (max-width: 470px) { .photo-editor { grid-template-columns: 1fr; } }
.address-box { white-space: pre-wrap; font: inherit; line-height: 1.55; padding: 13px; margin: 12px 0 0; background: #f1f3eb; border-radius: 8px; overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checklist { padding: 0; list-style: none; margin: 13px 0 0; }
.checklist li { border-top: 1px solid var(--line); padding: 7px 0; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.checklist label { display: flex; align-items: center; gap: 7px; min-height: 32px; }
.checklist .detail { color: var(--muted); font-size: .8rem; text-align: right; }
dialog { width: min(430px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 15px; color: var(--ink); padding: 23px; background: #fffdf8; box-shadow: 0 14px 60px #0b211958; }
dialog::backdrop { background: #0b241cab; }
.welcome-rules { list-style: none; padding: 0; margin: 16px 0 4px; display: grid; gap: 9px; }
.welcome-rules li { display: flex; gap: 10px; line-height: 1.45; }
dialog h2 { padding-right: 35px; font-size: 2.1rem; }
dialog h3 { margin-top: 15px; font-size: 1rem; }
.participant-name { border: 0; background: transparent; color: var(--green); font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
dialog p { color: var(--muted); line-height: 1.5; margin: 7px 0; }
dialog .btn { margin-top: 12px; }
.dialog-close { min-height: 38px; min-width: 38px; color: var(--ink); background: #edece5; border: 0; border-radius: 50%; position: absolute; right: 14px; top: 14px; font-size: 1.2rem; }
.form-error { color: #a02e35; margin-top: 9px; font-size: .88rem; font-weight: 650; }
.form-error:empty { display: none; }
#notice { position: fixed; z-index: 7; bottom: 18px; right: 18px; max-width: min(420px, calc(100% - 36px)); padding: 11px 15px; color: #fffaf0; background: #143b2e; border-radius: 9px; box-shadow: 0 5px 18px #122c2b31; }
#notice:empty { display: none; }
.loading { color: var(--muted); padding: 25px 0; }
@media (max-width: 850px) {
  .shell { width: calc(100% - 44px); }
  .hero { padding: 33px; }
  .display { right: 2%; scale: .87; transform-origin: bottom right; }
  .gift-grid { gap: 10px; }
  .gift-art { height: 133px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 30px); }
  .top-inner { grid-template-columns: 1fr auto; gap: 0 9px; padding: 8px 0 5px; }
  nav { order: 3; grid-column: 1 / -1; margin-top: 4px; overflow: auto; }
  nav a { padding: 7px 8px; font-size: .82rem; }
  .brand { font-size: 1.13rem; gap: 7px; }
  .brand-icon { width: 28px; height: 28px; }
  #account { gap: 4px; }
  .avatar { display: none; }
  main { padding-top: 15px; }
  .hero {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 29vw, 146px);
    column-gap: 10px; padding: 21px 17px 12px; min-height: 0;
  }
  .hero-copy { display: contents; }
  .hero-copy > :not(.hero-actions) { grid-column: 1 / -1; z-index: 2; }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.15rem); }
  .hero p { max-width: 40ch; font-size: .91rem; }
  .hero-actions { align-items: center; margin-top: 8px; z-index: 2; }
  .hero-actions .btn { padding-inline: 12px; }
  .display { grid-column: 2; position: relative; inset: auto; width: auto; height: 64px; scale: none; }
  .display .scene { width: 245px; bottom: 0; right: 0; scale: .45; transform-origin: bottom right; }
  .display .sky-star:nth-child(odd) { display: none; }
  .display .sky-star:nth-child(2) { left: 83%; top: 2px; font-size: 15px; }
  .display .sky-star:nth-child(4) { left: 11%; top: 13px; font-size: 11px; }
  .statusbar { padding: 11px; margin-top: 12px; gap: 8px; }
  .gallery { margin-top: 27px; }
  .gallery-heading { display: block; }
  .filters { width: fit-content; margin-top: 12px; }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gift-art { height: 125px; }
  .gift-meta { padding: 9px; }
}
@media (max-width: 360px) {
  .display .scene { scale: .37; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
.legal-top { min-height: 64px; display: flex; align-items: center; }
.legal { line-height: 1.6; }
.legal h2 { margin-top: 1.35em; }
.legal p { max-width: 68ch; }
.practice-notice { margin-top: 14px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px;
  justify-content: space-between; background: #f3ead4; border-radius: 8px; color: #563e15; font-size: .88rem; }
.gift-art.revealed { background: #f2ede1; color: #695f4f; font-size: .85rem; }
.gift-art.revealed::before, .gift-art.revealed::after { content: none; }
.gift-art.revealed button, .gift-art.revealed img { display: block; width: 100%; height: 100%; }
.gift-art.revealed img { object-fit: contain; }
.gift-art.revealed button:focus-visible { outline-offset: -3px; }
.photo-editor input[type="range"]:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(1); }

.match-list { list-style: none; margin: 0; padding: 0; }
.match { display: flex; align-items: center; gap: 16px; }
.match img { width: 78px; height: 78px; object-fit: contain; background: #f2ede1; border-radius: 8px; flex: none; }
.match dl { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 6px 0; }
.match dl div { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.match dt { color: var(--muted); font-size: .85rem; }
.match dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.gift-art.revealed button { padding: 0; border: 0; background: transparent; }
.gift-popup-image { display: block; width: 100%; max-height: 65dvh; object-fit: contain; margin-top: 12px; }
.steal-status h2 { font-size: 1.35rem; margin-top: 8px; }
[data-form="assign-teams"] { margin-top: 18px; }
[data-form="assign-teams"] select { width: min(52%, 250px); }
