:root {
  --night: #071a26;
  --pine: #0c3a2c;
  --red: #c81e2f;
  --red-d: #9c1321;
  --green: #1c7a4b;
  --gold: #f2c14e;
  --cream: #fff9ee;
  --ink: #1f2d27;
  --muted: #5d6b64;
  --line: #eadfca;
  --r: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 50% -10%, #17486b 0%, transparent 60%), linear-gradient(180deg, var(--night) 0%, #0a2a2c 45%, var(--pine) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.45;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red-d); }

/* string lights */
.lights { position: relative; z-index: 2; display: flex; justify-content: space-around; height: 34px; border-top: 3px solid #14342a; margin-top: 10px; }
.lights i { width: 13px; height: 19px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: var(--c); margin-top: 4px; position: relative; box-shadow: 0 0 14px 3px var(--c); animation: twinkle 1.9s ease-in-out infinite; animation-delay: var(--d); }
.lights i::before { content: ""; position: absolute; top: -6px; left: 3px; width: 7px; height: 6px; background: #14342a; border-radius: 2px; }
.lights i:nth-child(odd) { margin-top: 10px; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; box-shadow: 0 0 4px 0 var(--c); } }

/* hero */
.hero { position: relative; z-index: 1; text-align: center; color: #fff; padding: 6px 18px 26px; max-width: 980px; margin: 0 auto; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.countdown { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: .92rem; }
.who-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: .92rem; }
.who-btn:hover { background: rgba(255,255,255,.14); }
.kicker { color: var(--gold); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }
.kicker.dark { color: var(--red-d); text-align: center; margin-bottom: 8px; }
.hero h1 { font-family: "Mountains of Christmas", "Nunito", serif; font-size: clamp(2.7rem, 9vw, 5.4rem); line-height: 1; margin: 8px 0 12px; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.hero h1 span { color: var(--gold); }
.tagline { max-width: 620px; margin: 0 auto; font-size: 1.06rem; color: #dcebe4; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* photos of Micah, pinned up like instant prints */
.photos { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 24px auto 4px; }
.photos figure { margin: 0; background: #fff; padding: 8px 8px 6px; border-radius: 6px; width: 168px; transform: rotate(var(--t)); box-shadow: 0 10px 24px rgba(0,0,0,.4); transition: transform .2s; position: relative; }
.photos figure::before { content: "📌"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 1.2rem; }
.photos figure:hover { transform: rotate(0) scale(1.06); z-index: 2; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; }
.photos figcaption { color: #1f2d27; font-weight: 800; font-size: .8rem; padding-top: 6px; line-height: 1.2; }

/* buttons */
.btn { border: 0; border-radius: 99px; padding: 11px 20px; font-weight: 800; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 8px 14px; font-size: .9rem; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 4px 0 #125636; }
.btn.gold { background: var(--gold); color: #3b2a00; box-shadow: 0 4px 0 #b98a1c; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.btn.ghost.light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--red-d); font-weight: 800; text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* tabs */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 10px 12px; background: rgba(7,26,38,.82); backdrop-filter: blur(8px); }
.tabs button { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 99px; padding: 9px 16px; font-weight: 800; }
.tabs button.on { background: var(--cream); color: var(--red-d); }

main { position: relative; z-index: 1; max-width: 1080px; margin: 18px auto 0; padding: 0 14px; }
.panel { background: var(--cream); border-radius: 26px; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.35); border-top: 8px solid var(--red); background-image: repeating-linear-gradient(135deg, transparent 0 22px, rgba(200,30,47,.035) 22px 44px); }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 14px; text-align: center; }
.hint { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 14px; }
.sub { margin: 26px 0 10px; font-size: 1.1rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row.center { justify-content: center; }
.notice { background: #fff3c9; border: 1px dashed #d4a72c; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 0 0 14px; }
.chips button { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 6px 13px; font-weight: 700; font-size: .92rem; }
.chips button.on { background: var(--green); border-color: var(--green); color: #fff; }
.chips.small button { font-size: .84rem; padding: 4px 11px; }
.chips.small button.on { background: var(--red); border-color: var(--red); }
.modes { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.modes button { border: 2px solid var(--line); background: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 900; }
.modes button.on { border-color: var(--red); background: var(--red); color: #fff; }
.search { display: block; width: min(420px, 100%); margin: 0 auto 14px; padding: 11px 16px; border-radius: 99px; border: 2px solid var(--line); background: #fff; }

/* pictures: festive tile underneath, product photo on top when there is one */
.pic { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 30% 25%, #ffffff55 0 9%, transparent 10%), radial-gradient(circle at 78% 70%, #ffffff33 0 6%, transparent 7%), linear-gradient(135deg, #1c7a4b, #0f5132); display: grid; place-items: center; }
.pic::before { content: attr(data-e); font-size: clamp(2.6rem, 8vw, 4rem); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 46%, rgba(242,193,78,.55) 46% 54%, transparent 54%); pointer-events: none; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; z-index: 1; }
.pic.big { aspect-ratio: 16 / 10; }
.card:nth-child(3n) .pic, .wish:nth-child(3n) .pic { background-image: radial-gradient(circle at 30% 25%, #ffffff55 0 9%, transparent 10%), radial-gradient(circle at 78% 70%, #ffffff33 0 6%, transparent 7%), linear-gradient(135deg, #c81e2f, #8f1220); }
.card:nth-child(3n+1) .pic, .wish:nth-child(3n+1) .pic { background-image: radial-gradient(circle at 30% 25%, #ffffff55 0 9%, transparent 10%), radial-gradient(circle at 78% 70%, #ffffff33 0 6%, transparent 7%), linear-gradient(135deg, #17486b, #0c2c44); }

.tagrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.tag { font-size: .76rem; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: .05em; }
.pricetag { font-weight: 900; color: var(--red-d); font-size: .92rem; white-space: nowrap; }
.brand { color: var(--muted); font-weight: 700; font-size: .9rem; }
.small { font-size: .88rem; color: var(--muted); }
.pill { display: inline-block; background: #efe6d2; border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: .86rem; }
.pill.ok { background: #d8f1e2; color: #125636; }
.pill.taken { background: #ffe1e4; color: var(--red-d); }

/* grid of ideas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.card-open { border: 0; padding: 8px 8px 0; background: none; display: block; width: 100%; }
.card-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card h3 { font-size: 1.02rem; line-height: 1.25; }
.blurb { font-size: .9rem; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 10px; }

/* nice or naughty deck */
.deck { position: relative; width: min(390px, 100%); height: 470px; margin: 0 auto; }
.swipe { position: absolute; inset: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.2); touch-action: pan-y; user-select: none; transition: transform .25s ease, opacity .25s ease; overflow: hidden; }
.swipe.under { transform: scale(.95) translateY(14px); filter: brightness(.96); }
.swipe.top { cursor: grab; }
.swipe.drag { transition: none; cursor: grabbing; }
.swipe.fly-right { transform: translateX(130%) rotate(18deg) !important; opacity: 0; }
.swipe.fly-left { transform: translateX(-130%) rotate(-18deg) !important; opacity: 0; }
.swipe.fly-down { transform: translateY(40%) scale(.9) !important; opacity: 0; }
.swipe-body { padding: 10px 8px 4px; }
.swipe h3 { font-size: 1.3rem; line-height: 1.2; }
.swipe-body > p { margin-top: 4px; }
.ribbon { background: var(--gold); color: #3b2a00; font-weight: 900; font-size: .84rem; text-align: center; border-radius: 10px; padding: 5px; margin-bottom: 8px; }
.stamp { position: absolute; top: 26px; font-weight: 900; font-size: 1.5rem; padding: 4px 12px; border: 4px solid; border-radius: 10px; opacity: 0; z-index: 3; background: rgba(255,255,255,.85); }
.stamp.nice { left: 22px; color: var(--green); transform: rotate(-14deg); }
.stamp.naughty { right: 22px; color: var(--red); transform: rotate(14deg); }
.swipe[data-lean="yes"] .stamp.nice, .swipe.fly-right .stamp.nice, .swipe[data-lean="no"] .stamp.naughty, .swipe.fly-left .stamp.naughty { opacity: 1; }
.deck-btns { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.round { border: 0; border-radius: 20px; width: 108px; padding: 10px 6px; font-weight: 900; background: #fff; box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.round span { display: block; font-size: 1.9rem; }
.round.nice { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 4px 0 #125636; }
.round.naughty { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 4px 0 var(--red-d); }
.round:hover { transform: translateY(-2px); }

/* showdown */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.fighter { background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .15s; }
.fighter:hover { transform: translateY(-4px); border-color: var(--red); }
.fighter h4 { font-size: 1.1rem; margin-top: 8px; }
.pickme { margin-top: auto; align-self: center; background: var(--red); color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 900; }
.vs { align-self: center; font-family: "Mountains of Christmas", serif; font-size: 2.2rem; color: var(--red-d); }
.champ { text-align: center; }
.crown { font-size: 3rem; }
.champ-card { width: min(380px, 100%); margin: 12px auto; background: #fff; border: 3px solid var(--gold); border-radius: 20px; padding: 10px 10px 16px; }
.champ-card h4 { font-size: 1.3rem; margin-top: 10px; }

/* the list */
.wishes { display: grid; gap: 12px; }
.wish { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.wish.taken { background: #f6f1e4; }
.wish.taken .pic { filter: grayscale(.6); }
.wish h3 { font-size: 1.1rem; }
.wish-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.note { margin-top: 6px; background: #fff7dc; border-radius: 8px; padding: 5px 9px; font-size: .92rem; }
.note-in { width: 100%; margin-top: 8px; border: 1px dashed #cdbf9f; border-radius: 8px; padding: 7px 10px; background: #fffdf6; }
.pri { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pri button { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: .8rem; font-weight: 800; }
.pri button.on { border-color: var(--green); background: #d8f1e2; }
.pri-read { font-weight: 800; font-size: .88rem; margin-top: 4px; }
.shops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.shop { text-decoration: none; background: #f3ecdb; border-radius: 99px; padding: 4px 11px; font-weight: 800; font-size: .82rem; color: var(--ink); }
.shop:first-child { background: var(--ink); color: #fff; }
.shop:hover { background: var(--gold); color: #3b2a00; }
.famhead { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.famhead label, .dlg label, .sizes-form label { display: grid; gap: 4px; font-weight: 800; font-size: .9rem; }
.famhead input, .dlg input, .sizes-form input { border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; font-weight: 600; min-width: 0; }
.count { font-size: 1.05rem; }
.sizes { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.sizes summary { font-weight: 900; cursor: pointer; }
.sizes summary small { font-weight: 600; color: var(--muted); }
.sizes-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; align-items: end; }
.sizes-form .wide { grid-column: span 3; }
.sizes.read span { margin-left: 12px; white-space: nowrap; }
.sizes.read i { color: var(--muted); }
.sent, .old ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sent li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sent li .pill { margin-left: auto; }
.old { margin-top: 16px; }
.old summary { cursor: pointer; font-weight: 800; }
.old li { padding: 4px 0; }
.empty { text-align: center; padding: 26px 10px; }
.empty.wide { grid-column: 1 / -1; }
.empty h3 { font-size: 1.3rem; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 480px; margin: 0 auto 12px; }
.big-e { font-size: 3rem; }

/* dialogs */
.dlg { border: 0; border-radius: 24px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.5); border-top: 8px solid var(--red); }
.dlg::backdrop { background: rgba(4,14,20,.7); backdrop-filter: blur(3px); }
.dlg-body { padding: 22px; position: relative; display: grid; gap: 10px; }
.dlg h2 { font-size: 1.5rem; line-height: 1.2; }
.x { position: absolute; top: 10px; right: 12px; z-index: 4; border: 0; background: #fff; width: 34px; height: 34px; border-radius: 50%; font-weight: 900; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.err { color: var(--red-d); font-weight: 800; min-height: 1em; font-size: .9rem; }
.grabbed { max-height: 130px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.unwrap .pic { animation: unwrap .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes unwrap { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 55% { transform: scale(1.06) rotate(4deg); opacity: 1; } 75% { transform: rotate(-3deg); } 100% { transform: none; } }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 80px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px; font-weight: 800; z-index: 50; transition: transform .25s; max-width: calc(100vw - 30px); text-align: center; }
#toast.show { transform: translate(-50%, 0); }
.burst { position: fixed; top: -40px; font-size: 1.8rem; z-index: 60; pointer-events: none; animation: fall 2.3s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: .6; } }

footer { position: relative; z-index: 1; text-align: center; color: #b9d0c6; font-size: .85rem; padding: 30px 16px 40px; display: grid; gap: 6px; }

@media (max-width: 640px) {
  .photos { gap: 10px; }
  .photos figure { width: 42%; max-width: 160px; }
  .panel { padding: 16px 12px; border-radius: 20px; }
  .wish { grid-template-columns: 92px 1fr; }
  .wish-act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; align-items: center; }
  .versus { grid-template-columns: 1fr; }
  .vs { justify-self: center; }
  .sizes-form { grid-template-columns: 1fr 1fr; }
  .sizes-form .wide { grid-column: span 2; }
  .deck { height: 450px; }
  .round { width: 96px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 8px 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
