:root {
  color-scheme: light;
  --ink: #29231f;
  --muted: #685b52;
  --paper: #fcf8f0;
  --line: #ded3c4;
  --red: #9e2035;
  --red-dark: #711527;
  --gold: #f5d992;
  --green: #163e34;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; color: var(--ink); background: #f4ede2; min-width: 280px }
button, input, textarea { font: inherit }
button { cursor: pointer }
button:disabled { cursor: wait; opacity: .68 }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #477961; outline-offset: 3px }
h1,h2,h3,p { margin: 0 }
h1,h2,h3 { font-family: Georgia, 'Times New Roman', serif; line-height: 1.05 }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.025em }
.page { width: min(74rem, calc(100% - 3rem)); margin: auto }
.masthead { min-height: 5.4rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-bottom: 1px solid #d7cabc }
.brand { display: inline-flex; gap: .7rem; align-items: center; font-weight: 800; letter-spacing: .16em; font-size: .79rem }
.brand-mark { display: grid; place-items: center; color: var(--gold); background: var(--red); border-radius: 50%; width: 2rem; height: 2rem; font-size: 1.25rem; line-height: 1; letter-spacing: 0 }
.gate { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); margin: clamp(1.4rem, 5vw, 4.5rem) 0 3rem; min-height: 34rem; background: var(--paper); border: 1px solid var(--line); border-radius: 1.15rem; overflow: hidden; box-shadow: 0 20px 60px #54352114 }
.poster { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.65rem, 5vw, 4rem); overflow: hidden; color: #fff3da; background: radial-gradient(ellipse at 71% 75%, #bf453e 1%, transparent 58%), linear-gradient(128deg, #a52539, #75152d); min-height: 31rem }
.poster::before { content: ''; position: absolute; inset: .85rem; border: 1px solid #ffdfa85c; border-radius: .6rem; pointer-events: none }
.poster::after { content: ''; position: absolute; inset: 0; opacity: .19; z-index: -1; background: repeating-linear-gradient(45deg, #ffd8a233 0 1px, transparent 1px 5px) }
.poster-copy { z-index: 1; animation: appear .62s ease-out both }
.poster h1 { font-size: clamp(4.5rem, 9.5vw, 8rem); line-height: .79; letter-spacing: -.083em; text-shadow: 0 3px #520d2240 }
.poster h1 em { font-weight: normal; color: var(--gold) }
.poster p { margin-top: 1.5rem; letter-spacing: .015em }
.poster p strong { white-space: nowrap }
.snow { position: absolute; inset: 1.5rem; pointer-events: none; color: var(--gold) }
.snow i { position: absolute; font-style: normal; filter: drop-shadow(0 0 10px #f4cba078) }
.snow i:nth-child(1) { animation: soft-twinkle 3s ease-in-out 2; top: 4%; right: 9%; font-size: 2.5rem }
.snow i:nth-child(2) { top: 21%; right: 0; font-size: 1.5rem }
.snow i:nth-child(3) { right: 12%; top: 35% }
.snow i:nth-child(4) { bottom: 10%; left: 3%; font-size: 2.3rem }
.snow i:nth-child(5) { bottom: 26%; left: 21%; opacity: .55 }
.snow i:nth-child(6) { animation: soft-twinkle 3s .25s ease-in-out 2; bottom: 13%; right: 6%; font-size: 1.7rem }
.gift-display { display: grid; justify-items: center; margin: 1rem 0 0; padding-left: 25%; height: 10rem }
.gift { width: 9.2rem; height: 6.7rem; margin-top: 2.3rem; position: relative; transform: rotate(-12deg); filter: drop-shadow(.75rem 1rem .7rem #470c268c) }
.box,.lid { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg,#fff1ad40 0 .11rem,transparent .11rem .8rem), linear-gradient(130deg,#d9ebbd,#9cba86); border: 1px solid #557a52; border-radius: .24rem }
.box { top: .65rem; bottom: 0; box-shadow: inset -.65rem -.5rem #243e2a35 }
.lid { top: 0; height: 1.7rem; left: -.35rem; right: -.35rem; box-shadow: 0 .35rem #29482e3a }
.box::after, .lid::after { content: ''; position: absolute; inset: 0 auto 0 39%; width: 22%; background: linear-gradient(90deg,#c9943b,#f4d893 20% 75%,#c68f3c); box-shadow: .1rem 0 .15rem #4c60225c }
.bow { position: absolute; top: -1.65rem; left: 50%; color: #e4b85e }
.bow::before,.bow::after { content: ''; position: absolute; width: 2.65rem; height: 1.8rem; border: .44rem solid currentColor; box-shadow: inset 0 0 .22rem #8a4c23, 0 1px .15rem #6d2e25; border-radius: 85% 70% 5% 75% }
.bow::before { right: -.04rem; transform: rotate(20deg) }
.bow::after { left: -.04rem; transform: scaleX(-1) rotate(25deg) }
.ribbon-knot { position: absolute; top: -.35rem; left: 44%; z-index: 1; width: 12%; height: .85rem; border-radius: .35rem; background: #f2cf7d }
.tag { position: absolute; z-index: 2; top: 1.1rem; left: 64%; width: 2.8rem; padding: .38rem .25rem; text-align: center; color: #6d3926; line-height: 1.1; font: italic .68rem Georgia,serif; background: #fff0c8; transform: rotate(18deg); box-shadow: .15rem .25rem #49341c32; border-radius: .1rem }
.tag b { color: #a02a3b }
.login-panel { animation: appear .62s .09s ease-out both; align-self: center; padding: clamp(1.5rem, 5vw, 4.25rem); width: 100% }
.login-panel > p, .wish-card > p, dialog > p { margin: .85rem 0 1.45rem; color: var(--muted) }
label { display: block; font-size: .91rem; font-weight: 700; margin: .9rem 0 .35rem }
label span { color: var(--muted); font-weight: 400 }
input,textarea { display: block; width: 100%; padding: .67rem .8rem; background: #fffcf6; color: var(--ink); border: 1px solid #b8ac9d; border-radius: .45rem }
textarea { resize: vertical }
.primary,.quiet,.outline,.gold-button,.text-button { min-height: 2.75rem; padding: .67rem 1.05rem; border-radius: .45rem; font-weight: 750; border: 1px solid transparent }
.primary { background: var(--red); color: white }
.primary:hover { background: var(--red-dark) }
#login-submit { width: 100%; margin-top: .9rem }
.quiet { color: var(--ink); background: transparent }
.quiet:hover,.outline:hover { background: #ede3d5 }
.text-button { border: 0; background: none; color: var(--red); padding-left: 0; padding-right: 0; text-align: left; text-decoration: underline; text-underline-offset: .22em; margin-top: .75rem }
.error { color: #9b1831; margin-top: .65rem; font-size: .92rem }
.error:empty,.light-error:empty,.status:empty { display: none }
.greeting { margin: clamp(1.6rem, 5vw, 3.7rem) 0 1.4rem; display: flex; align-items: end; justify-content: space-between; gap: .85rem; flex-wrap: wrap }
.greeting h1 { font-size: clamp(3rem, 7vw, 5.6rem); letter-spacing: -.07em }
.budget { color: var(--green); border: 1px solid #aeb9a3; border-radius: 4rem; padding: .4rem .8rem; font-size: .9rem }
.budget strong { margin-left: .3rem }
.status { margin: 0 0 .6rem; color: var(--green) }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 1rem; align-items: start; margin-bottom: 3rem }
.draw-card,.wish-card { border-radius: .95rem; padding: clamp(1.3rem, 4vw, 2.7rem); min-width: 0 }
#draw-card {
  position: relative; isolation: isolate;
  background: radial-gradient(ellipse at 48% 45%, #336b55, #163c33 72%);
  color: #fff6df; overflow: hidden;
}
#draw-card::before {
  content: ''; position: absolute; z-index: -1; inset: .65rem; border: 1px solid #e8cf8d51;
  border-radius: .6rem; pointer-events: none;
}
.draw-copy p { margin-top: .65rem; color: #f0e5c7 }
#sealed { position: relative; display: grid; justify-items: center }
.draw-visual {
  position: relative; width: min(100%, 22rem); min-height: 13.5rem;
  display: grid; place-items: center; isolation: isolate;
}
.draw-visual::before {
  content: ''; position: absolute; width: 10rem; height: 10rem; border-radius: 50%;
  border: 1px solid #fde3a535; box-shadow: 0 0 0 1.15rem #fde3a50d, 0 0 0 2.4rem #fde3a509;
}
.envelope {
  width: 10.1rem; height: 6.7rem; position: relative; perspective: 400px;
  background: linear-gradient(135deg,#fff1ce,#d8bb7e);
  border-radius: .42rem; box-shadow: 0 .72rem 1.15rem #081c1688, inset 0 0 0 1px #8e6e3a46;
  transform: rotate(-8deg);
}
.envelope::after {
  position: absolute; z-index: 2; inset: 0; content: ''; border-radius: inherit;
  background: linear-gradient(28deg,#e1ca95,#fff2ce);
  clip-path: polygon(0 100%,0 17%,50% 49%,100% 17%,100% 100%);
}
.letter {
  position: absolute; z-index: 1; background: #fffae8; border: 1px solid #d6bc8b; border-radius: .17rem;
  inset: .55rem .85rem .55rem; box-shadow: 0 0 .45rem #75563151;
}
.letter::before {
  content: '✦'; position: absolute; top: .25rem; left: 50%; transform: translateX(-50%);
  color: var(--red); font-size: 1.45rem;
}
.flap {
  position: absolute; z-index: 3; inset: 0 0 35%; border-radius: .35rem;
  background: linear-gradient(157deg,#fff0ca,#eac575); clip-path: polygon(0 0,100% 0,100% 8%,51% 98%,49% 98%,0 8%);
  transform-origin: top;
}
.seal {
  display: grid; place-items: center; position: absolute; z-index: 4; left: calc(50% - .99rem);
  top: 3.1rem; width: 1.98rem; height: 1.98rem; background: var(--red); color: var(--gold);
  border: 2px solid #bb515c; box-shadow: 0 2px 3px #28110e51; border-radius: 50%;
}
.spark { position: absolute; color: var(--gold); font-size: 1.45rem; line-height: 1; opacity: .8 }
.spark-a { left: 12%; top: 25% }.spark-b { right: 12%; top: 23%; font-size: 2rem }
.spark-c { right: 19%; bottom: 17%; font-size: .9rem }.spark-d { left: 21%; bottom: 22%; font-size: 1rem }
.spark-e { left: 43%; top: 12%; font-size: .76rem }
.ready .envelope { animation: envelope-float 2.8s ease-in-out 2 }
.ready .spark-a,.ready .spark-c { animation: soft-twinkle 2.8s ease-in-out 2 }
.ready .spark-b,.ready .spark-d { animation: soft-twinkle 2.8s .28s ease-in-out 2 }
#reveal { display: block; width: min(100%, 18rem); margin: -.35rem auto .3rem; text-align: center }
#reveal::before { content: ''; position: absolute; inset: 0 0 3rem; border-radius: .65rem }
#reveal:focus-visible { outline-color: #fff3bb }
.ready:has(#reveal:hover) .envelope { filter: brightness(1.075) }
.opening .envelope { animation: open-letter 1.15s ease both }
.opening .flap { animation: lift-flap 1.15s ease both }
.opening .seal { animation: break-seal 1.15s ease both }
.opening .letter { animation: raise-letter 1.15s ease both }
.opening .spark { animation: glimmer 1.15s ease both }
@keyframes envelope-float { 50% { transform: translateY(-.45rem) rotate(-5deg) } }
@keyframes soft-twinkle { 50% { opacity: .45; transform: scale(.8) } }
@keyframes open-letter {
  23% { transform: rotate(0) scale(1.08) }
  65% { transform: rotate(0) translateY(.35rem) scale(1.06) }
  to { transform: rotate(0) translateY(1.25rem) scale(.93); opacity: 0 }
}
@keyframes lift-flap { 20% { transform: none } 55%,to { transform: rotateX(167deg); z-index: 0 } }
@keyframes break-seal { 15% { opacity: 1 } 43%,to { transform: scale(.7) translateY(1.35rem); opacity: 0 } }
@keyframes raise-letter {
  42% { transform: none } 74% { transform: translateY(-3.4rem) } to { transform: translateY(-4rem); opacity: 0 }
}
@keyframes glimmer { 45% { opacity: 1; transform: scale(1.35) rotate(25deg) } to { opacity: 0; transform: scale(.3) translateY(-2rem) } }
.confetti {
  position: absolute; z-index: 3; top: 5.3rem; left: 50%; width: 0; height: 0;
  pointer-events: none; color: #ffdd8f;
}
.confetti span { position: absolute; animation: scatter .95s cubic-bezier(.15,.55,.3,1) both; opacity: 0 }
.confetti span:nth-child(3n+1) { color: #ffd9bf }
.confetti span:nth-child(3n+2) { color: #b6d69d }
.confetti span:nth-child(1) { --x: -6rem; --y: -2.6rem; --turn: -210deg }
.confetti span:nth-child(2) { --x: -8rem; --y: 1.8rem; --turn: 140deg }
.confetti span:nth-child(3) { --x: -7.5rem; --y: 4.8rem; --turn: 240deg }
.confetti span:nth-child(4) { --x: -4rem; --y: 6rem; --turn: -90deg }
.confetti span:nth-child(5) { --x: 4rem; --y: -2.8rem; --turn: 175deg }
.confetti span:nth-child(6) { --x: 7rem; --y: -1.6rem; --turn: -250deg }
.confetti span:nth-child(7) { --x: 8rem; --y: 2.5rem; --turn: 200deg }
.confetti span:nth-child(8) { --x: 5.5rem; --y: 6rem; --turn: 320deg }
.confetti span:nth-child(9) { --x: .5rem; --y: -3.2rem; --turn: 150deg }
.confetti span:nth-child(10) { --x: -4rem; --y: -.7rem; --turn: -90deg }
.confetti span:nth-child(11) { --x: 6rem; --y: 4.5rem; --turn: 150deg }
.confetti span:nth-child(12) { --x: -1rem; --y: 5.5rem; --turn: -150deg }
@keyframes scatter {
  0% { opacity: 0; transform: translate(0,0) scale(.2) }
  23% { opacity: 1 }
  to { opacity: 0; transform: translate(var(--x),var(--y)) rotate(var(--turn)) }
}
.draw-result {
  min-height: 12rem; display: grid; justify-items: center; align-content: center;
  text-align: center; padding: 1.4rem 0; animation: appear .52s both;
}
.draw-result p { font-size: .94rem; color: #ebdcba }
.recipient-name {
  margin-top: .4rem; font: bold clamp(3rem, 8vw, 5.1rem)/1.05 Georgia, serif;
  color: var(--gold); overflow-wrap: anywhere;
}
.recipient-mask { filter: blur(.32rem); user-select: none; letter-spacing: .045em }
h3.recipient-name { animation: focus-name .28s ease-out both }
@keyframes focus-name { from { filter: blur(.32rem); opacity: .6 } }
.eye-button {
  border: 1px solid #f5d99272; min-height: 2.75rem; display: inline-flex; align-items: center; gap: .48rem;
  background: #fff3dc0c; color: #fff0c8; padding: .48rem .7rem;
  margin-top: .65rem; border-radius: .6rem;
}
.eye-button svg { width: 1.28rem; height: 1.28rem }
.eye-button:hover { background: #fff3dc23 }
.eye-button:focus-visible { outline-color: var(--gold) }
.recipient-list { animation: appear .52s .11s both }
@keyframes appear { from { opacity: 0; transform: translateY(.65rem) } }
.sr-only {
  position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px;
  clip-path: inset(50%); white-space: nowrap;
}
.gold-button { background: var(--gold); color: #2f261c }
.gold-button:hover { background: #ffe7aa }
.light-error { margin-top: .6rem; color: #ffe0e4 }
.recipient-list { border-top: 1px solid #ffffff45; padding-top: 1.1rem }
.recipient-list a { color: var(--gold) }
.wish-card { background: var(--paper); border: 1px solid var(--line); min-height: 18rem }
.outline { background: transparent; color: var(--ink); border-color: #b8a897 }
ul { padding: 0; list-style: none; margin: 1rem 0 }
.wish-item { border-block-start: 1px solid #b7a99a80; padding: .85rem 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .2rem .7rem; overflow-wrap: anywhere }
.wish-item p { grid-column: 1/-1; white-space: pre-wrap }
.wish-item a { text-underline-offset: .2em; font-size: .93rem }
.wish-card a { color: var(--red) }
.item-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: end }
.item-actions button { background: none; border: none; min-height: 2.75rem; padding: .25rem .4rem; color: var(--red); text-decoration: underline; text-underline-offset: .2em }
dialog { width: min(30rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: clamp(1rem, 5vw, 2rem); border-radius: .85rem; box-shadow: 0 1rem 5rem #23171355 }
dialog::backdrop { background: #211b17a8 }
dialog[open] { animation: dialog-in .26s cubic-bezier(.2,.8,.25,1) both }
dialog[open]::backdrop { animation: backdrop-in .22s ease-out both }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(.85rem) scale(.97) }
}
@keyframes backdrop-in { from { opacity: 0 } }
.dialog-actions { display: flex; margin-top: 1.15rem; justify-content: flex-end; gap: .5rem }
@media (max-width: 48rem) {
  .page { width: calc(100% - 1.4rem) }
  .masthead { min-height: 3.65rem }
  .gate,.dashboard-grid { grid-template-columns: 1fr }
  .poster { min-height: 17rem; padding: 2rem 1.65rem; justify-content: start }
  .poster h1 { font-size: clamp(4.1rem, 14vw, 6.2rem) }
  .poster p { margin-top: 1.1rem; max-width: 60% }
  .gift-display { position: absolute; right: 6%; bottom: 7%; transform-origin: bottom right; transform: scale(.64); margin: 0; padding: 0 }
  .snow i:nth-child(4),.snow i:nth-child(5),.snow i:nth-child(6) { display: none }
  .snow i:nth-child(1) { right: 9%; top: 0 }
  .snow i:nth-child(3) { right: 21% }
}
@media (max-width: 22rem) {
  .wish-item { grid-template-columns: minmax(0,1fr) }
  .item-actions { justify-content: start }
  .gift-display { transform: scale(.49) }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important }
}
