/* Tinsel: pine, cranberry and gold on warm paper. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/fraunces-latin-full-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(fonts/fraunces-latin-full-italic.woff2) format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-wght-normal.woff2) format('woff2'); }

:root {
  --pine: #17352a; --pine-2: #22483a; --pine-3: #2f5d4b;
  --berry: #a8243a; --berry-2: #c2364d; --berry-soft: #f6dfe0;
  --gold: #c9a04a; --gold-2: #e3c37a; --gold-soft: #f4e7c8;
  --paper: #f7f1e5; --card: #fffdf8; --line: #e6dccb; --ink: #23201b; --ink-2: #5e574c; --ink-3: #8c8476;
  --ok: #2e7d55;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(35, 32, 27, .06), 0 8px 24px -12px rgba(35, 32, 27, .18);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--berry); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- the evening band at the top */
.sky {
  position: relative; overflow: hidden; color: #f7f1e5;
  background: radial-gradient(120% 90% at 85% -10%, #2f5d4b 0%, transparent 60%), linear-gradient(180deg, #12291f 0%, var(--pine) 100%);
  padding: calc(env(safe-area-inset-top) + 18px) 20px 64px;
}
.sky::after { /* scalloped edge, like the bottom of a stocking cuff */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px;
  background: radial-gradient(circle at 14px 22px, var(--paper) 13px, transparent 13.5px) 0 0 / 28px 22px repeat-x;
}
.snow { position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 64%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 47% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 90% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 78%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 38% 86%, #fff 50%, transparent 51%); }
.sky-in { position: relative; max-width: 760px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); }
.brand svg { width: 20px; height: 20px; }
.sky h1 { font: 500 clamp(30px, 7vw, 44px)/1.08 var(--serif); font-variation-settings: 'SOFT' 100, 'WONK' 1; margin: 22px 0 6px; letter-spacing: -.01em; }
.sky h1 em { font-style: italic; color: var(--gold-2); }
.sky .sub { color: #cfd9d2; margin: 0; font-size: 16px; }
.link-btn { background: none; border: 0; color: #cfd9d2; padding: 8px 4px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: #fff; }

main { max-width: 760px; margin: -36px auto 0; padding: 0 16px calc(env(safe-area-inset-bottom) + 40px); position: relative; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2 { font: 600 22px/1.2 var(--serif); margin: 0 0 4px; }
.card .hint { color: var(--ink-2); margin: 0 0 14px; font-size: 15px; }
.eyebrow { font: 700 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--berry); margin: 0 0 8px; }

/* ---------- buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; font-weight: 650; background: var(--berry); color: #fff; transition: transform .12s, background .15s; }
.btn:hover { background: var(--berry-2); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: #f3ecdf; }
.btn.pine { background: var(--pine); } .btn.pine:hover { background: var(--pine-3); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: #f1e9db; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.f > small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.in { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; outline: 0; transition: border-color .15s; }
.in:focus { border-color: var(--pine-3); }
textarea.in { min-height: 76px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.err { color: var(--berry); font-weight: 600; font-size: 14px; min-height: 20px; margin: 4px 0 0; }

/* segmented control */
.seg { display: inline-flex; background: #efe6d6; border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-weight: 650; color: var(--ink-2); min-height: 40px; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* chips (pick people) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; color: var(--ink-2); min-height: 38px; }
.chip[aria-pressed=true] { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip.auto { border-style: dashed; }
.chip[disabled] { opacity: .45; }

/* ---------- sign-in: who are you? */
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.name-btn { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; min-height: 60px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 650; transition: border-color .15s, transform .12s; }
.name-btn:hover { border-color: var(--gold); }
.name-btn:active { transform: scale(.98); }
.av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 16px/1 var(--serif); color: #fff; background: var(--c, var(--pine)); }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(18, 41, 31, .5); display: grid; align-items: end; justify-items: center; z-index: 20; animation: fade .2s; }
.sheet { width: min(560px, 100%); max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px); animation: up .26s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font: 600 24px/1.2 var(--serif); margin: 4px 0 4px; }
.sheet .hint { color: var(--ink-2); margin: 0 0 16px; }
.sheet-foot { display: flex; gap: 10px; margin-top: 8px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 24px; padding-bottom: 24px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* PIN pad */
.dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pine-3); transition: background .12s, transform .12s; }
.dots i.on { background: var(--pine); transform: scale(1.1); }
.dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 8px auto 0; }
.pad button { height: 60px; border-radius: 16px; border: 0; background: #f3ecdf; font: 600 24px/1 var(--sans); }
.pad button:active { background: var(--gold-soft); }
.pad .muted { background: none; font-size: 15px; color: var(--ink-2); }

/* ---------- the gift tag */
.tag-wrap { perspective: 1200px; margin: 4px 0 4px; }
.tag { position: relative; border-radius: 22px; overflow: hidden; color: #fff; min-height: 200px; padding: 26px 92px 26px 24px;
  background: radial-gradient(90% 120% at 100% 0%, #c2364d 0%, transparent 55%), linear-gradient(160deg, #a8243a 0%, #7d1729 100%);
  box-shadow: 0 18px 40px -18px rgba(125, 23, 41, .7); }
.tag::before { /* ribbon down the right side */ content: ''; position: absolute; top: 0; bottom: 0; right: 34px; width: 22px; background: linear-gradient(90deg, #b88a32, var(--gold-2) 45%, #b88a32); }
.tag .bow { position: absolute; z-index: 1; right: 13px; top: 22px; width: 64px; height: 44px; color: var(--gold-2); filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.tag > * { position: relative; z-index: 1; }
.tag .eyebrow { color: var(--gold-2); }
.tag .who { font: 500 clamp(36px, 10vw, 56px)/1.05 var(--serif); font-variation-settings: 'SOFT' 100, 'WONK' 1; margin: 6px 0 0; letter-spacing: -.01em; }
.tag .tap { position: absolute; z-index: 2; left: calc(50% - 34px); top: 50%; transform: translate(-50%, -50%); background: var(--paper); color: var(--ink); border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.25); min-height: 48px; }
.tag.closed .who, .tag.closed .after { filter: blur(14px); user-select: none; }
.tag .after { margin-top: 14px; color: #f5d9dc; font-size: 15px; }
.tag.opening { animation: lift .6s cubic-bezier(.2,.8,.2,1); }
@keyframes lift { 0% { transform: rotateX(0); } 40% { transform: rotateX(10deg) translateY(-6px); } 100% { transform: none; } }
.tag.waiting { background: linear-gradient(160deg, var(--pine-2), var(--pine)); box-shadow: 0 18px 40px -18px rgba(18, 41, 31, .7); }
.tag.waiting .who { font-size: clamp(26px, 7vw, 34px); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.fact { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-soft); color: #6d5317; border-radius: 999px; padding: 6px 12px; font-weight: 650; font-size: 14px; }
.fact svg { width: 16px; height: 16px; }
.note-box { background: #fbf7ee; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; padding: 10px 14px; margin-top: 12px; color: var(--ink-2); font-size: 15px; }

/* ---------- wish lists */
.wishes { list-style: none; margin: 0; padding: 0; }
.wish { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.wish:first-child { border-top: 0; }
.wish .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold-soft); color: #6d5317; display: grid; place-items: center; font: 600 14px/1 var(--serif); margin-top: 2px; }
.wish .body { flex: 1; min-width: 0; }
.wish .t { font-weight: 650; overflow-wrap: anywhere; }
.wish .meta { color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.wish .meta a { font-weight: 600; }
.wish .price { color: var(--ok); font-weight: 650; }
.wish .acts { display: flex; flex: none; }
.wish.bought .t { text-decoration: line-through; color: var(--ink-3); }
.check { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; margin-top: 1px; }
.check svg { width: 18px; height: 18px; opacity: 0; color: #fff; }
.check[aria-pressed=true] { background: var(--ok); border-color: var(--ok); }
.check[aria-pressed=true] svg { opacity: 1; }
.empty { text-align: center; color: var(--ink-2); padding: 18px 8px 8px; }
.empty svg { width: 44px; height: 44px; color: var(--gold); display: block; margin: 0 auto 8px; }

.tabs { display: flex; justify-content: center; margin: 4px 0 16px; }

/* ---------- admin */
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .body { flex: 1; min-width: 0; }
.person .nm { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person .fam { color: var(--ink-2); font-size: 14px; }
.badge { font: 700 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: #e8efe9; color: var(--pine-3); }
.badge.kid { background: var(--berry-soft); color: var(--berry); }
.badge.warn { background: #fde7c6; color: #8a5300; }
.stats { display: flex; gap: 12px; color: var(--ink-3); font-size: 13px; margin-top: 2px; flex-wrap: wrap; }
.stats .yes { color: var(--ok); font-weight: 650; }
.toggle { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle:first-of-type { border-top: 0; }
.toggle .body { flex: 1; }
.toggle .body b { display: block; }
.toggle .body small { color: var(--ink-2); font-size: 14px; }
.switch { appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #d9cfbd; position: relative; transition: background .15s; margin: 2px 0 0; cursor: pointer; }
.switch::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,.25); transition: transform .18s; }
.switch:checked { background: var(--pine-3); }
.switch:checked::after { transform: translateX(20px); }
.sealed { display: flex; gap: 16px; align-items: center; background: linear-gradient(160deg, var(--pine-2), var(--pine)); color: #f7f1e5; border-radius: var(--r); padding: 18px 20px; }
.sealed svg { flex: none; width: 48px; height: 48px; color: var(--gold-2); }
.sealed b { font: 600 20px/1.2 var(--serif); display: block; }
.sealed span { color: #cfd9d2; font-size: 15px; }
.result { border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-weight: 600; font-size: 15px; }
.result.ok { background: #e3f1e8; color: #1f5f3e; }
.result.no { background: var(--berry-soft); color: var(--berry); }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 30; box-shadow: var(--shadow); animation: up .2s; max-width: calc(100% - 32px); text-align: center; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 24px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } .card { padding: 18px 16px; } }
.chip.auto[aria-pressed=true] { background: #e6efe9; color: var(--pine); border-color: var(--pine-3); border-style: dashed; opacity: 1; }
.matches { list-style: none; margin: 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.matches li { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-weight: 600; }
.matches li:first-child { border-top: 0; }
.matches li:nth-child(odd) { background: #fbf7ee; }
.matches .arrow { color: var(--berry); display: grid; place-items: center; }
.matches .arrow svg { width: 20px; height: 20px; }
.matches li span:last-child { text-align: right; }
