:root {
  color-scheme: dark;
  --green: #10352b;
  --deep: #08271f;
  --cream: #fff3da;
  --muted: #e6d5b1;
  --gold: #e6ba66;
  --cranberry: #a12d49;
  --ink: #203b31;
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 50% 28%, #2a5943 0%, transparent 62%) top / 100% 880px no-repeat,
    linear-gradient(145deg, var(--green), var(--deep));
}
button, input, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; }
:focus-visible { outline: 3px solid #da932d; outline-offset: 4px; }
h1, h2, .brand, .ornament span { font-family: Georgia, 'Times New Roman', serif; }
h1, h2, p { margin: 0; }

.lights {
  position: relative;
  display: flex;
  justify-content: space-around;
  height: 27px;
  border-top: 2px solid #52624a;
  background: linear-gradient(#04191280, transparent);
  pointer-events: none;
}
.lights i {
  position: relative;
  width: 9px;
  height: 15px;
  top: 4px;
  transform: rotate(14deg);
  border-radius: 45% 45% 60% 60%;
  color: #ffce7b;
  background: currentColor;
  box-shadow: inset 2px 1px 4px #fff9d588, 0 0 14px currentColor;
  animation: twinkle 6s var(--phase, -2s) ease-in-out infinite alternate;
}
.lights i::before {
  content: '';
  position: absolute;
  inset: -5px 1px auto;
  height: 5px;
  border-radius: 2px;
  background: #646a4e;
}
.lights i:nth-child(2n) { --phase: -5s; color: #eb6983; transform: rotate(-13deg); }
.lights i:nth-child(3n) { color: #9cdbb1; }
.lights i:nth-child(5n) { --phase: -3s; color: #fff0bc; transform: rotate(0deg); }

@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

.snow { pointer-events: none; position: fixed; inset: 0; overflow: hidden; }
.snow i {
  position: absolute;
  left: var(--x, 12%);
  top: -8px;
  height: 4px;
  width: 4px;
  border-radius: 50%;
  background: #fff8e0;
  animation: snow var(--time, 22s) var(--delay, -4s) linear infinite;
  opacity: .42;
}
.snow i:nth-child(2) { --x: 23%; --time: 29s; --delay: -11s; width: 3px; height: 3px; }
.snow i:nth-child(3) { --x: 32%; --time: 27s; --delay: -18s; }
.snow i:nth-child(4) { --x: 40%; --time: 31s; --delay: -7s; }
.snow i:nth-child(5) { --x: 53%; --time: 33s; --delay: -29s; }
.snow i:nth-child(6) { --x: 62%; --time: 26s; --delay: -15s; }
.snow i:nth-child(7) { --x: 71%; --time: 34s; --delay: -4s; }
.snow i:nth-child(8) { --x: 80%; --time: 24s; --delay: -9s; width: 3px; height: 3px; }
.snow i:nth-child(9) { --x: 89%; --time: 28s; --delay: -20s; }
.snow i:nth-child(10) { --x: 96%; --time: 27s; --delay: -6s; }
@keyframes snow { to { transform: translate(24px, calc(100vh + 12px)); } }

.site-header, main { position: relative; width: min(100% - 32px, 860px); margin: auto; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 16px;
  padding: 8px 0;
  border-bottom: 1px solid #e6ba664a;
}
.brand { display: inline-flex; align-items: center; min-height: 48px; gap: 9px; font-size: 1.25rem; text-decoration: none; }
.brand span { color: var(--gold); }
nav { display: flex; flex-wrap: wrap; }
nav button, .back {
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--cream);
}
nav button:hover, .back:hover { text-decoration: underline; }
main { padding-bottom: 56px; }
.hero { padding: clamp(21px, 5vw, 55px) 0 19px; text-align: center; }
.hero-sprig { display: block; margin: 0 auto 9px; }
.hero h1 {
  font-size: clamp(2.55rem, 9.7vw, 5rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 3px 16px #041b15b3;
}
.hero p { color: var(--muted); margin: 10px auto 0; max-width: 29ch; line-height: 1.45; text-wrap: balance; }
.wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 13px clamp(12px, 4vw, 25px);
  max-width: 660px;
  margin: 0 auto;
}
.ornament {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  width: clamp(88px, 25vw, 144px);
  min-height: 48px;
  border: 0;
  padding: 17px 0 2px;
  background: none;
  color: var(--cream);
  --rim: #ebbb71;
  --shade: #8e5b32;
  animation: sway 8s var(--phase, -1s) ease-in-out infinite;
  transform-origin: 50% 0;
  transition: rotate .22s ease;
}
.ornament:nth-child(2n) { --phase: -4s; --rim: #db8492; --shade: #893244; }
.ornament:nth-child(3n) { --phase: -6s; }
.ornament:nth-child(4n) { --rim: #b6cfa5; --shade: #537b64; }
@media (hover: hover) { .ornament:hover { rotate: -5deg; } }
.ornament:active { rotate: 3deg; }
.ornament::before {
  position: absolute;
  content: '';
  top: 10px;
  width: 22px;
  height: 9px;
  border-radius: 4px 4px 1px 1px;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, #72502252 3px 4px),
    linear-gradient(90deg, #ba883e, #ffda89, #ba883e);
}
.ornament::after {
  position: absolute;
  content: '';
  top: 1px;
  width: 8px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}
.ornament img {
  display: block;
  width: min(calc(100% - 8px), 116px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--rim);
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--rim), var(--shade));
  box-shadow: 0 0 0 1px #0c241c, 0 6px 15px #041a13b8;
}
.ornament span { font-size: clamp(1.04rem, 3vw, 1.3rem); text-shadow: 0 1px 4px #041c13; }
@keyframes sway { 0%, 100% { transform: rotate(-1.7deg); } 50% { transform: rotate(1.7deg); } }
.signin-call { margin: 20px 0 0; text-align: center; }
.signin-call button { min-width: min(100%, 205px); }
.primary, .secondary {
  min-height: 48px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 650;
}
.primary { background: linear-gradient(#a3304d, #89223d); box-shadow: inset 0 1px #f6cf902b, 0 3px 9px #331a1c32; color: #fff9e9; border-color: #e6ba6680; }
.primary:hover { background: #84223a; }
.secondary { background: transparent; color: #174637; border-color: #80755b; }
.secondary:hover { background: #ead8b5; }

dialog, .wish, .empty { color-scheme: light; color: var(--ink); background:
  radial-gradient(ellipse at 12% 0%, #fffdf2, transparent 80%),
  repeating-linear-gradient(135deg, #ab793507 0 1px, transparent 1px 4px),
  var(--cream);
  border: 1px solid #c99f58; border-radius: 15px;
  box-shadow: 0 8px 24px #041a135c; }
dialog {
  width: min(100% - 30px, 450px);
  padding: 24px;
  max-height: calc(100dvh - 24px);
}
dialog::backdrop { background: #031510d4; }
dialog h2 { font-size: 2rem; padding-right: 40px; margin-bottom: 16px; }
.close {
  position: absolute;
  right: 10px;
  top: 10px;
  height: 48px;
  width: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-size: 1.7rem;
}
.close:hover { background: #ead8b5; }
form { display: grid; gap: 10px; }
label { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-weight: 600; }
label span { color: #545c4d; font-weight: 400; }
input, textarea {
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #867b64;
  border-radius: 6px;
  background: #fffaf0;
  color: var(--ink);
  padding: 8px 10px;
}
textarea { resize: vertical; }
.demo { background: #ead8b5; padding: 10px 12px; border-radius: 6px; font-weight: 700; }
.message { color: #7d2037; line-height: 1.45; }
#login-error:not(:empty) { margin-top: 12px; }
.notice { color: #ffdbab; margin: 14px 0; }
.message:empty, .notice:empty, .signin-call:not(:has(button:not([hidden]))) { display: none; }
#preview-photo { max-width: 86px; max-height: 86px; border-radius: 6px; object-fit: contain; }

#detail { max-width: 720px; margin: 8px auto 0; }
.back { padding-left: 0; }
.list-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 6px 0 20px; }
.list-header h1 { font-size: clamp(2.25rem, 8vw, 3.4rem); font-weight: 500; letter-spacing: -.04em; }
.list-header::after { content: ''; display: block; width: 100%; height: 1px; background: linear-gradient(90deg, #e6ba66a3, #e6ba660d); }
.enter .list-header, .enter .wish, .enter .empty { animation: rise .35s both; }
.enter .wish:nth-child(2) { animation-delay: .06s; }
.enter .wish:nth-child(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.wishes { display: grid; gap: 12px; }
.empty { padding: 20px; }
.wish { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-left: 3px solid #c48d5b; }
.wish-photo { width: clamp(62px, 16vw, 102px); aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #f2e3c4; }
.wish-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.wish h2 { font-size: 1.4rem; }
.wish h2:has(a) { display: flex; }
.wish a { display: inline-flex; align-items: center; min-height: 48px; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.recipient, .price { font-weight: 650; margin-bottom: 3px; }
.price, .note { margin-top: 5px; }
.note { white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.status { position: relative; margin-right: auto; background: #ead8b5; color: #492b1e; border-radius: 20px; padding: 4px 10px; font-weight: 650; font-size: .9rem; }

.status[data-state="claimed"] { background: #dce8d4; color: #284734; }
.status[data-state="bought"] { background: #f0d6db; color: #6b2437; }
.sparkle {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  color: #805412;
  pointer-events: none;
  animation: sparkle .64s ease-out both;
}
@keyframes sparkle {
  from { opacity: 0; transform: translateY(0) scale(.65); }
  26% { opacity: 1; }
  to { opacity: 0; transform: translateY(-1.7rem) scale(1.35); }
}

@media (max-width: 540px) {
  .lights i:nth-child(n+13) { display: none; }
  .site-header { padding: 0; }
  .brand { font-size: 1.16rem; }
  nav { width: 100%; border-top: 1px solid #e6ba6633; }
  nav button { flex: 1; min-width: 48px; }
  .has-add { padding-bottom: 68px; }
  .has-add .list-header .primary {
    position: fixed;
    z-index: 2;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 4px 22px #031811bf;
  }
  /* A transformed heading container would pin the fixed button to the header. */
  .enter.has-add .list-header { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .snow, .sparkle { display: none; }
  .lights i, .ornament, .enter .list-header, .enter .wish, .enter .empty { animation: none; }
  .ornament { transition: none; rotate: none; }
}

.doc { max-width: 680px; margin: 0 auto; padding: 26px 0 10px; line-height: 1.6; }
.doc h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 500; margin-bottom: 6px; }
.doc h2 { font-size: 1.3rem; font-weight: 600; margin: 26px 0 8px; color: var(--gold); }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc-meta { color: var(--muted); margin-bottom: 20px; }
