@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url(fonts/nunito-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Mountains of Christmas'; font-weight: 700; font-display: swap; src: url(fonts/mountains-of-christmas-latin-700-normal.woff2) format('woff2'); }

/* Winternacht: glass over the 3D village, warm paper for lists */
:root {
  --ink: #1d2b44; --muted: #5d6b82; --paper: #fffdf8; --card: #ffffff; --line: #ece6d9; --sand: #f1ebdf; --sand-d: #e4dccb;
  --red: #b8322a; --red-d: #8f241d; --gold: #f6c94c; --gold-ink: #7a4f00; --green: #1e7a46; --green-d: #17603a;
  --violet: #4b2fa0; --violet-bg: #efe9ff; --night: #0a1830;
  --glass: rgba(8, 20, 40, .62); --glass-line: rgba(255, 255, 255, .12);
  --radius: 18px; --shadow: 0 24px 70px rgba(3, 8, 20, .45);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); /* (ux-fix) landscape notch */
  --panel-w: 456px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); font-family: Nunito, system-ui, sans-serif; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.ava { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ava.lg { width: 44px; height: 44px; font-size: 18px; font-family: Nunito, sans-serif; }

/* ---------- HUD (top glass bar) ---------- */
#hud { position: fixed; top: calc(12px + var(--safe-t)); left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 8px 8px 8px 20px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: 0 12px 40px rgba(3, 8, 20, .35); transition: right .45s cubic-bezier(.2,.8,.2,1); }
.brand { font-family: 'Mountains of Christmas', cursive; font-size: 32px; font-weight: 700; color: #fff; line-height: 1; white-space: nowrap; }
.countdown { display: inline-flex; align-items: center; gap: 6px; color: #ffe3a3; font-weight: 700; font-size: 14px; white-space: nowrap;
  background: rgba(255, 215, 120, .14); padding: 6px 12px; border-radius: 99px; }
.countdown .star { width: 14px; height: 14px; fill: var(--gold); stroke: none; }
.cd-short { display: none; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.08); }
.pill { height: 44px; border: 0; background: transparent; color: #fff; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 15px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .2s; }
.pill:hover { background: rgba(255,255,255,.12); }
.pill.primary { background: var(--paper); color: var(--ink); }
.pill.primary:hover { background: #fff; }
.pill .ico { display: none; }
.pill.icon { width: 44px; padding: 0; justify-content: center; }
.pill.icon .ico { display: block; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 52px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; }
.menu button { display: block; width: 100%; min-height: 44px; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--ink); }
.menu button:hover { background: var(--sand); }
.menu hr { border: 0; border-top: 1px solid var(--line, rgba(0,0,0,.1)); margin: 6px 8px; } /* (menues) family things above, housekeeping below */

/* ---------- dock (family chips) ---------- */
.dock { position: fixed; left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 4; pointer-events: none; transition: right .45s cubic-bezier(.2,.8,.2,1); }
.dock > * { pointer-events: auto; }
.hint { margin: 0; color: #fff; background: var(--glass); padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: center; }
.family { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(8, 20, 40, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.family::-webkit-scrollbar { display: none; }
.family button { flex: none; height: 44px; border: 0; background: rgba(255,255,255,.92); border-radius: 999px; padding: 0 16px 0 6px; font-weight: 800; font-size: 15px;
  cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); transition: transform .15s; }
.family button:hover { transform: translateY(-1px); }
.family button.active { background: var(--paper); box-shadow: 0 0 0 3px var(--gold); }
.panel-open #hud, .panel-open .dock { right: calc(var(--panel-w) + 32px + var(--safe-r)); } /* (ux-fix) safe-r */

/* ---------- side panel (desktop: floating card, phone: bottom sheet) ---------- */
.panel { --mc: var(--red); position: fixed; top: calc(16px + var(--safe-t)); right: calc(16px + var(--safe-r)); bottom: 16px; width: var(--panel-w); background: var(--paper); z-index: 6;
  border-radius: 26px; box-shadow: var(--shadow); transform: translateX(calc(100% + 40px)); transition: transform .45s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto; overscroll-behavior: contain; padding: 0 24px calc(32px + var(--safe-b)); border-top: 6px solid var(--mc); }
.panel.open { transform: none; }
.sheet-handle { display: none; }
.panel-close { position: sticky; top: 16px; float: right; margin: 16px -6px 0 8px; border: 0; background: var(--sand); width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.panel-close:hover { background: var(--sand-d); }
.p-title { font-family: 'Mountains of Christmas', cursive; font-size: 32px; line-height: 1.05; margin: 20px 0 4px; display: flex; align-items: center; gap: 12px; }
.p-sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.secret-note { background: #fff6dc; border: 1px solid #f0d58a; border-radius: 14px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.progress { height: 8px; background: #ece6d8; border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .5s; }

form.card-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
form.card-form label { font-weight: 800; font-size: 15px; display: block; margin-bottom: 8px; }
.field { width: 100%; min-height: 48px; border: 1.5px solid #ddd5c5; border-radius: 12px; padding: 10px 14px; background: var(--paper); color: var(--ink); font-size: 16px; }
.field:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(184,50,42,.14); }
textarea.field { resize: vertical; min-height: 72px; }
select.field { appearance: auto; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; min-width: 0; }
details.more { margin: 10px 0; } details.more summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
details.more .row, details.more textarea { margin-top: 8px; }
.btn { min-height: 44px; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; cursor: pointer; background: var(--red); color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); transition: transform .1s, background .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--red-d); } .btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; margin-top: 10px; min-height: 52px; font-size: 16px; }
.btn.ghost { background: var(--sand); color: var(--ink); box-shadow: none; } .btn.ghost:hover { background: var(--sand-d); }
.btn.green { background: var(--green); } .btn.green:hover { background: var(--green-d); }
.btn.danger { background: var(--red); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px 6px; font-size: 14px; min-height: 44px; min-width: 44px; } /* (menues) 44 px to tap */

.wish { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px;
  position: relative; animation: pop .35s ease both; }
.wish.taken { background: #f7f4ee; }
.wish.taken .wtitle { color: var(--muted); }
.wish .thumb { width: 76px; height: 76px; flex: none; border-radius: 16px; border: 0; padding: 6px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #fff, var(--c2, #fbeee0)); box-shadow: inset 0 0 0 3px var(--c0, #c0392b); transition: transform .2s; }
.wish .thumb:hover { transform: rotate(-4deg) scale(1.05); }
.wish .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wish .thumb.has-photo { padding: 0; overflow: hidden; background: #fff; }
.wish .thumb img.photo { object-fit: cover; border-radius: 13px; }
.mi { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; margin-right: 4px; }
.meta span, .meta a { display: inline-flex; align-items: center; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.chip { display: inline-flex; align-items: center; }
.chip .mi { width: 13px; height: 13px; }
.secret-note { display: flex; gap: 8px; align-items: flex-start; }
.secret-note .mi { width: 18px; height: 18px; margin-top: 1px; color: var(--gold-ink); }
details.more summary .mi { margin-right: 6px; color: var(--violet); }
.wbody { flex: 1; min-width: 0; }
.wtitle { font-weight: 800; font-size: 17px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.prio { color: #c98a00; font-size: 13px; letter-spacing: 1px; }
.tagline { color: var(--muted); font-size: 14px; margin: 2px 0 4px; font-style: italic; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.meta a { color: var(--red); font-weight: 700; word-break: break-all; }
.note { font-size: 14px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.chip { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: #e9f4ed; color: var(--green-d); }
.chip.mine { background: #fff1d1; color: var(--gold-ink); } .chip.other { background: #eeeae2; color: #4d5566; }
.chip.secret { background: var(--violet-bg); color: var(--violet); }
.group-h { font-weight: 800; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .big { font-size: 46px; }
.total { background: var(--card); border-radius: 14px; padding: 14px; border: 1px solid var(--line); display: flex; justify-content: space-between; font-weight: 800; margin-top: 14px; }
.member-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.member-row .row { align-items: center; }
.member-row input[type=color] { flex: none; width: 44px; height: 44px; border: 0; padding: 0; background: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ---------- overlay (login / setup) ---------- */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at center, rgba(10,24,48,.3), rgba(10,24,48,.8)); overflow-y: auto; }
.overlay-card { background: rgba(255,253,248,.97); border-radius: 28px; padding: 32px; width: min(520px, 100%); box-shadow: var(--shadow); text-align: center; animation: pop .5s ease both; }
.overlay .title { font-family: 'Mountains of Christmas', cursive; font-size: 56px; color: var(--red); line-height: 1; }
.overlay .sub { color: var(--muted); margin: 8px 0 20px; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.who button { min-height: 92px; border: 0; background: var(--card); border-radius: 18px; padding: 14px 10px; cursor: pointer; font-weight: 800; font-size: 17px; color: var(--ink);
  box-shadow: inset 0 0 0 2px #e6dfd1, 0 6px 16px rgba(29,43,68,.08); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.who button:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--c, #ccc), 0 10px 22px rgba(29,43,68,.12); }
.who .house-ico { width: 44px; height: 40px; }
.overlay form { text-align: left; }
.overlay form .field { margin-bottom: 10px; }
.err { color: var(--red); font-weight: 700; min-height: 1.2em; font-size: 14px; margin: 4px 0; }
.setup-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.setup-row input[type=color] { width: 44px; height: 44px; border: 0; background: none; padding: 0; flex: none; }

/* ---------- unwrap animation ---------- */
.unwrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(6,14,30,.8); backdrop-filter: blur(4px); padding: 16px 16px calc(16px + var(--safe-b)); overflow-y: auto; }
.unwrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.uw-inner { width: min(460px, 100%); min-width: 0; text-align: center; color: #fff; }
.uw-stage { position: relative; width: 300px; height: 300px; margin: 0 auto; }
.uw-rays { position: absolute; inset: -60px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255,226,140,.35) 0deg 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); }
.uw-gift { position: absolute; left: 50%; bottom: 40px; width: 170px; height: 170px; transform: translateX(-50%); }
.uw-box { position: absolute; bottom: 0; left: 10px; width: 150px; height: 118px; border-radius: 10px;
  background: linear-gradient(90deg, transparent 43%, var(--c1) 43% 57%, transparent 57%), var(--c0);
  box-shadow: inset 0 -12px 0 rgba(0,0,0,.15), 0 18px 30px rgba(0,0,0,.35); }
.uw-lid { position: absolute; bottom: 108px; left: 0; width: 170px; height: 38px; border-radius: 8px;
  background: linear-gradient(90deg, transparent 43%, var(--c1) 43% 57%, transparent 57%), var(--c0);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); filter: brightness(1.08); transform-origin: 20% 100%; }
.uw-bow { position: absolute; left: 50%; top: -30px; width: 0; height: 0; }
.uw-bow i { position: absolute; top: 0; width: 46px; height: 34px; border: 9px solid var(--c1); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.uw-bow i:first-child { right: 0; transform: rotate(-20deg); } .uw-bow i:last-child { left: 0; transform: rotate(20deg); }
.uw-img { position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; transform: translate(-50%, -30%) scale(.1); opacity: 0;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.uw-confetti { position: absolute; inset: -150px; width: 600px; height: 600px; pointer-events: none; }
.uw-status { min-height: 26px; font-weight: 700; color: #ffe3a3; margin-top: 6px; }
.uw-text { opacity: 0; transform: translateY(10px); transition: all .6s .2s; }
.uw-title { font-family: 'Mountains of Christmas', cursive; font-size: 40px; margin: 4px 0; line-height: 1.1; overflow-wrap: anywhere; }
.uw-title[contenteditable=true] { outline: 2px dashed rgba(255,255,255,.35); border-radius: 8px; padding: 0 8px; cursor: text; }
.uw-tagline { margin: 0 0 8px; color: #dfe7f5; font-size: 17px; }
.uw-extra { font-size: 14px; color: #b9c6dc; }
.uw-extra a { color: #ffd98a; }
.uw-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; opacity: 0; transition: opacity .4s .5s; }
.unwrap.open .uw-text, .unwrap.open .uw-actions { opacity: 1; transform: none; }
.unwrap.wrapping .uw-gift { animation: wobble 1s ease-in-out infinite; }
.unwrap.open .uw-lid { animation: lidOff .9s cubic-bezier(.3,.7,.4,1) forwards; }
.unwrap.open .uw-box { animation: boxAway .8s .35s ease forwards; }
.unwrap.open .uw-rays { animation: rays 1s .3s ease forwards, spin 18s linear infinite; }
.unwrap.open .uw-img { animation: rise .9s .45s cubic-bezier(.2,1.5,.4,1) forwards; }
.unwrap.open .uw-img.float { animation: floaty 3s ease-in-out infinite; opacity: 1; transform: translate(-50%, -55%) scale(1); }
@keyframes wobble { 0%,100% { transform: translateX(-50%) rotate(0) } 20% { transform: translateX(-50%) rotate(-6deg) translateY(-6px) }
  40% { transform: translateX(-50%) rotate(5deg) } 60% { transform: translateX(-50%) rotate(-3deg) translateY(-3px) } 80% { transform: translateX(-50%) rotate(2deg) } }
@keyframes lidOff { 30% { transform: translate(-10px, -40px) rotate(-12deg) } 100% { transform: translate(-150px, -260px) rotate(-70deg); opacity: 0 } }
@keyframes boxAway { to { transform: translateY(60px) scale(.85); opacity: 0 } }
@keyframes rays { to { opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes rise { to { transform: translate(-50%, -55%) scale(1); opacity: 1 } }
@keyframes floaty { 0%,100% { transform: translate(-50%, -55%) } 50% { transform: translate(-50%, -60%) rotate(2deg) } }
.uw-title-input { width: 100%; }
.uw-img.is-photo { object-fit: cover; background: #fff; border: 8px solid #fff; border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.4); filter: none; }
.uw-extra span, .uw-extra a { display: inline-flex; align-items: center; }
.uw-pick { margin-top: 12px; opacity: 0; transition: opacity .4s .5s; }
.unwrap.open .uw-pick { opacity: 1; }
.uw-pick p { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #b9c6dc; }
.pick-row { max-width: 100%; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; justify-content: flex-start; }
.pick-row button { flex: none; width: 52px; height: 52px; border-radius: 14px; border: 0; background: rgba(255,255,255,.92); padding: 6px; cursor: pointer; }
.pick-row button img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.pick-row button[data-pick=photo] { padding: 0; overflow: hidden; } .pick-row button[data-pick=photo] img { object-fit: cover; }
.pick-row button[aria-pressed=true] { box-shadow: 0 0 0 3px var(--gold); background: #fff; }

/* ---------- dialog & toast ---------- */
.dialog { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(6,14,30,.55); padding: 20px; }
.dialog-card { background: var(--paper); border-radius: 20px; padding: 22px; width: min(380px, 100%); box-shadow: var(--shadow); }
.dialog-card p { margin: 0 0 16px; font-weight: 600; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
body.toasting #hint { visibility: hidden; } /* (menues) one word on screen at a time */
/* (ux-fix) the whole width to wrap in (left: 50% gave it half the screen), centred without a transform (pop's transform
   made it jump sideways), and taps go through to the buttons below */
.toast { position: fixed; left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); margin: 0 auto; width: fit-content; bottom: calc(110px + var(--safe-b)); background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 14px; font-weight: 700; z-index: 40; box-shadow: var(--shadow); max-width: 560px; text-align: center; animation: pop .3s; pointer-events: none; }

/* ---------- tablet: narrower panel ---------- */
@media (max-width: 1100px) and (min-width: 761px) { :root { --panel-w: 400px; } }
@media (max-width: 1500px) and (min-width: 761px) {
  .panel-open .countdown { display: none; }
  .panel-open .pill .lbl { display: none; }
  .panel-open .pill .ico { display: block; }
  .panel-open .pill { padding: 0 12px; }
  .panel-open #btnMine .dot { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  #hud { left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); padding: 6px 6px 6px 14px; gap: 8px; border-radius: 18px; }
  .panel-open #hud, .panel-open .dock { right: calc(10px + var(--safe-r)); } /* (ux-fix) safe-l/r */
  .brand { font-size: 26px; }
  .countdown { background: none; padding: 0; font-size: 12px; position: absolute; left: 14px; bottom: 3px; }
  .countdown .star { display: none; }
  .cd-long { display: none; } .cd-short { display: inline; }
  #hud { padding-bottom: 18px; }
  .nav { background: none; padding: 0; gap: 6px; }
  .pill { width: 44px; padding: 0; justify-content: center; background: rgba(255,255,255,.12); border-radius: 14px; position: relative; }
  .pill.primary { background: var(--paper); }
  .pill .lbl, #btnMine .dot { display: none; }
  .pill .ico { display: block; }
  .pill .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
  .dock { left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); }
  .family { border-radius: 22px; justify-content: flex-start; }
  .family button { height: 48px; border-radius: 16px; padding: 0 14px 0 6px; }
  .family button .ava { width: 34px; height: 34px; }
  .panel-open .dock { display: none !important; }

  /* leaves a strip above the sheet in which the 3D view frames the house (village.js reads this height) */
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(66dvh, calc(100dvh - 210px)); border-radius: 28px 28px 0 0;
    border-top: 0; padding: 0 calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l)); /* (ux-fix) safe-l/r */ transform: translateY(105%); box-shadow: 0 -18px 50px rgba(3,8,20,.45); }
  .panel::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--mc); border-radius: 28px 28px 0 0; opacity: .9; }
  .sheet-handle { display: flex; justify-content: center; position: sticky; top: 0; z-index: 3; height: 26px; margin: 0 -16px; padding-top: 10px;
    background: var(--paper); cursor: grab; touch-action: none; }
  .sheet-handle i { width: 44px; height: 5px; border-radius: 99px; background: #ddd5c5; }
  .panel-close { top: 30px; margin-top: 0; }
  .p-title { font-size: 28px; margin-top: 4px; }
  .wish { gap: 12px; padding: 12px; flex-wrap: wrap; }
  .wish .thumb { width: 64px; height: 64px; border-radius: 14px; }
  .actions { gap: 8px; }
  .btn.small { min-height: 44px; font-size: 15px; }
  .btn.small.claim, .actions .btn.green { flex: 1 1 auto; }
  .row { flex-wrap: wrap; }

  .overlay { place-items: end stretch; padding: 0; }
  .overlay-card { width: 100%; border-radius: 28px 28px 0 0; padding: 24px 20px calc(28px + var(--safe-b)); max-height: 92dvh; overflow-y: auto; }
  .overlay .title { font-size: 48px; }
  .who { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uw-stage { width: 260px; height: 260px; }
  .uw-actions .btn { flex: 1 1 40%; }
  .dialog { place-items: end stretch; padding: 0; }
  .dialog-card { width: 100%; border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); }
  .dialog-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- round 2: lists with photos, checklist, unwrap ---------- */
.prio { color: #c98a00; font-size: 12px; font-weight: 800; letter-spacing: .5px; margin-top: 2px; }
.prio span { letter-spacing: 0; }
.wtitle { line-height: 1.25; }
.meta { margin-top: 6px; gap: 6px; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: 12px; font-weight: 800; text-decoration: none; }
.pill.link { background: #fdecea; color: var(--red); word-break: normal; }
.pill .mi { width: 12px; height: 12px; }
.wish.big { flex-wrap: wrap; padding: 10px; border-radius: 20px; }
.wish.big .thumb { width: 76px; height: 76px; } /* (23.11.) shorter cards: less scrolling */
.wish.big .actions { flex-basis: 100%; margin-top: 2px; flex-wrap: nowrap; }
.wish.big .actions .btn.claim { flex: 1 1 auto; min-height: 44px; font-size: 15px; border-radius: 12px; }
.group-label { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-label.strong { color: var(--ink); }
.group-label .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--sand-d); color: var(--ink); font-size: 12px; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.group-label.strong .count { background: var(--red); color: #fff; }
#pList > .group-label:first-child { margin-top: 4px; }
.wish.compact { align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; background: #f7f4ee; border-color: transparent; }
.wish.compact.mine { background: #fffaf0; border: 1.5px solid #f0d58a; }
.wish.compact .wtitle { font-size: 15px; }
.wish.compact.done .wtitle { color: #4d5566; }
.wish.compact .status { font-size: 13px; color: var(--muted); }
.wish.compact.mine .status { color: var(--gold-ink); font-weight: 700; }
.wish.compact .actions { margin-top: 0; flex-wrap: nowrap; }
.thumb.sm { width: 52px !important; height: 52px !important; border-radius: 12px !important; padding: 4px !important; }
.thumb.sm.has-photo { padding: 0 !important; }
.icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn .mi { width: 18px; height: 18px; margin: 0; }

.shop-summary { padding: 16px; border-radius: 20px; background: #10244a; color: #fff; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.shop-summary .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shop-summary b { font-size: 21px; }
.shop-summary .row1 span { color: #ffe3a3; font-weight: 700; }
.shop-summary .bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; }
.shop-summary .bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); transition: width .5s; }
.shop-summary p { margin: 0; font-size: 13px; color: #c9d6ee; }
.shop-head { display: flex; align-items: center; gap: 10px; margin: 18px 2px 8px; }
.shop-head b { flex: 1; font-size: 16px; }
.shop-head > span:not(.ava) { font-size: 13px; color: var(--muted); font-weight: 700; }
.shop-group { border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.shop-row + .shop-row { border-top: 1px solid var(--sand); }
.shop-row .check { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2.5px solid #c9c0ad; background: #fff; color: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.shop-row .check .mi { width: 20px; height: 20px; margin: 0; stroke-width: 3; }
.shop-row .check:hover { border-color: var(--green); color: rgba(30,122,70,.35); }
.shop-row.bought .check { background: var(--green); border-color: var(--green); color: #fff; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; border: 0; background: none; padding: 4px 0; cursor: pointer; }
.sr-title { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.sr-sub { font-size: 13px; color: var(--gold-ink); font-weight: 700; }
.shop-row.bought .sr-title { color: var(--muted); text-decoration: line-through; }
.shop-row.bought .sr-sub, .shop-row.gone .sr-sub { color: var(--muted); font-weight: 600; }

.uw-actions .btn.green { order: -1; flex: 1 1 100%; min-height: 54px; font-size: 17px; }
.uw-actions .btn.ghost { background: rgba(255,255,255,.14); color: #fff; flex: 1 1 40%; }
.uw-actions .btn.ghost:hover { background: rgba(255,255,255,.22); }
.uw-title[contenteditable=true]::after { content: ''; display: inline-block; width: 18px; height: 18px; margin-left: 8px; vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffe3a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l11-11-4-4L4 16z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Wunschometer (wish strength slider) ---------- */
.wm { --p: 50%; --c: #c9670f; margin: 14px 0 4px; }
.wm-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 15px; }
.wm-n { font-size: 12px; color: var(--muted); }
.wm-label { font-family: 'Mountains of Christmas', cursive; font-size: 30px; line-height: 1.1; text-align: center; color: var(--c); margin: 4px 0 2px; transition: color .3s; }
.wm-label.pop { animation: wmIn .45s cubic-bezier(.3,1.6,.5,1); }
.wm-track { position: relative; height: 64px; margin: 0 6px; }
.wm-rail { position: absolute; left: 0; right: 0; top: 25px; height: 14px; border-radius: 99px; background: #ece6d8; overflow: hidden; }
.wm-fill { display: block; height: 100%; width: var(--p); border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--c));
  transition: width .4s cubic-bezier(.3,1.4,.5,1); min-width: 14px; }
.wm-ticks { position: absolute; left: 4px; right: 4px; top: 29px; display: flex; justify-content: space-between; pointer-events: none; }
.wm-ticks i { width: 6px; height: 6px; border-radius: 50%; background: #d6cdbb; transition: background .3s; }
.wm-ticks i.on { background: rgba(255,255,255,.9); }
.wm-thumb { position: absolute; top: 4px; left: calc(var(--p) - 28px); width: 56px; height: 56px; border-radius: 50%; background: #fff; pointer-events: none;
  box-shadow: 0 6px 18px rgba(29,43,68,.22); display: flex; align-items: center; justify-content: center;
  transition: left .4s cubic-bezier(.3,1.4,.5,1), box-shadow .3s; }
.wm[data-v="1"] .wm-thumb { left: -4px; } .wm[data-v="5"] .wm-thumb { left: calc(100% - 52px); }
.wm-heart { width: 30px; height: 30px; fill: var(--c); transition: transform .45s cubic-bezier(.3,1.8,.4,1), fill .3s; transform: scale(.85); }
.wm[data-v="2"] .wm-heart { transform: scale(.95); } .wm[data-v="3"] .wm-heart { transform: scale(1.05); }
.wm[data-v="4"] .wm-heart { transform: scale(1.15); } .wm[data-v="5"] .wm-heart { transform: scale(1.25); }
.wm-thumb.beat { box-shadow: 0 6px 18px rgba(29,43,68,.22), 0 0 0 8px rgba(209,59,47,.16); }
.wm-thumb.beat .wm-heart { animation: wmBeat 1s ease-in-out infinite; }
.wm-range { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; touch-action: pan-y; }
.wm-range:focus-visible + * , .wm-track:focus-within .wm-thumb { outline: 3px solid var(--gold); outline-offset: 2px; }
.wm-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin: -6px 2px 0; }
.wm-spark { position: absolute; left: 24px; top: 24px; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; animation: wmSpark .7s ease-out forwards; }
@keyframes wmIn { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes wmBeat { 0%, 100% { transform: scale(1.25); } 15% { transform: scale(1.45); } 30% { transform: scale(1.2); } 45% { transform: scale(1.4); } }
@keyframes wmSpark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

.meter { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.meter .segs { display: flex; gap: 3px; }
.meter .segs i { width: 14px; height: 7px; border-radius: 4px; background: #ece6d8; }
.meter .ml { font-size: 12px; font-weight: 800; color: var(--c); }
.wish { overflow: hidden; }
.wish.top { border-color: #f3b8b2; box-shadow: 0 0 0 1px #f3b8b2; }
/* (ux-fix) the band's middle sits on the middle of the corner it crosses (39 px from both edges), so the 97 px word fits
   in its visible 110 px (at 35deg it showed "ERZENSWUNSC") */
.ribbon { position: absolute; top: 29px; right: -36px; width: 150px; transform: rotate(45deg); background: #d13b2f; color: #fff; font-size: 10px; font-weight: 800;
  text-align: center; padding: 3px 0; line-height: 14px; letter-spacing: .03em; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0,0,0,.15); z-index: 1; pointer-events: none; }
.wish.top .wtitle { padding-right: 52px; }

/* ---------- who may see a wish ---------- */
.who-pick { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.who-pick legend { font-weight: 800; font-size: 15px; padding: 0; margin-bottom: 8px; }
.who-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
.who-row::-webkit-scrollbar { display: none; }
.who-opt { position: relative; flex: none; }
.who-opt input { position: absolute; opacity: 0; pointer-events: none; }
.who-opt span { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--sand);
  font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .2s, box-shadow .2s, transform .15s; }
.who-opt span .mi { width: 20px; height: 20px; margin: 0 2px 0 6px; }
.who-opt span .ava { width: 32px; height: 32px; font-size: 13px; }
.who-opt input:checked + span { background: #fff; box-shadow: 0 0 0 2.5px var(--ink); transform: translateY(-1px); }
.who-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.who-hint { margin: 8px 2px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.who-hint.one { display: none; color: var(--violet); }
.who-pick.private .who-hint.all { display: none; }
.who-pick.private .who-hint.one { display: block; animation: wmIn .35s ease; }
@media (max-width: 760px) {
  .who-opt span { height: 40px; padding: 0 12px 0 4px; font-size: 14px; gap: 5px; }
  .who-opt span .ava { width: 30px; height: 30px; }
}
.chip.only { background: var(--violet-bg); color: var(--violet); }
.chip.only-me { background: #fff1d1; color: var(--gold-ink); }
.chip .mi { margin-right: 4px; }

/* ---------- adding from shops: paste button, help ---------- */
.q-row { display: flex; gap: 8px; }
.q-row .field { flex: 1; min-width: 0; }
.btn.paste { flex: none; min-height: 48px; padding: 0 12px; font-size: 14px; }
.btn.paste .mi { width: 17px; height: 17px; margin-right: 2px; }
.field.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 60% { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(246,201,76,.35); } }
.howto { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.howto.mine { border: 2px solid var(--gold); box-shadow: 0 6px 18px rgba(246,201,76,.18); }
.howto h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.howto h3 .mi { width: 18px; height: 18px; }
.howto p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.howto ol { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.howto ol li { margin: 3px 0; }
.howto .btn.block { margin: 4px 0 6px; text-decoration: none; }
.bookmarklet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--ink); color: #fff !important;
  font-weight: 800; text-decoration: none; cursor: grab; }
@media (max-width: 760px) {
  /* the close button scrolls with the sheet instead of floating over the form */
  .panel-close { position: absolute; top: 18px; right: 12px; margin: 0; float: none; z-index: 4; }
  .p-title { padding-right: 52px; }
}

/* phones: while your elf walks over, hide the name bar so the walk is fully visible */
@media (max-width: 760px) { body.walking .dock { opacity: 0; pointer-events: none; transition: opacity .3s; } }

/* ---------- invite links in the admin area ---------- */
.invite-box { margin-top: 10px; padding: 12px; border-radius: 14px; background: #f3f7ff; border: 1px solid #cdd9f0; }
.invite-box p { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.invite-box .field { font-size: 13px; min-height: 40px; }
.invite-box .actions .btn { text-decoration: none; }
.btn .mi { margin-right: 4px; }

.family-card { background: var(--card); border: 2px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.family-card h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.family-card h3 .mi { width: 18px; height: 18px; }
.family-card p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
