/* Winter Potluck. Shape rule: panels 20px, buttons and inputs full pill, avatars round. One accent: cranberry. */
@font-face { font-family: 'Bricolage'; src: url(/fonts/bricolage-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url(/fonts/bricolage-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url(/fonts/bricolage-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --bg: #eef3f8; --bg-2: #dce7f1; --sky: #dfe9f2;
  --ink: #13233a; --muted: #4a5d76; --faint: #6b7d94;
  --glass: rgb(255 255 255 / .62); --glass-line: rgb(255 255 255 / .8); --line: rgb(19 35 58 / .1);
  --accent: #b23a4a; --accent-ink: #fff8f6; --accent-soft: rgb(178 58 74 / .1);
  --shadow: 0 18px 50px -24px rgb(40 70 110 / .45);
  --frost-1: #e3eef7; --frost-2: #e9eef9; --frost-3: #eef0f5; --flake: rgb(120 150 185 / .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1726; --bg-2: #13233a; --sky: #15243b;
    --ink: #e7eff8; --muted: #a9bacd; --faint: #8b9db3;
    --glass: rgb(22 38 62 / .62); --glass-line: rgb(255 255 255 / .1); --line: rgb(231 239 248 / .1);
    --accent: #e8707f; --accent-ink: #1a0d10; --accent-soft: rgb(232 112 127 / .14);
    --shadow: 0 18px 50px -24px rgb(0 0 0 / .7);
    --frost-1: #142941; --frost-2: #172741; --frost-3: #1a2639; --flake: rgb(255 255 255 / .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; font-family: 'Bricolage', ui-sans-serif, system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(120% 80% at 80% -10%, var(--bg-2), transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
input { font-size: max(16px, 1em); } /* iOS zooms into inputs under 16px */
[hidden] { display: none !important; }

.glass {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 20px;
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), var(--shadow);
}
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--bg); backdrop-filter: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; white-space: nowrap;
  min-height: 44px; padding: 0 1.15rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-weight: 600; transition: transform .15s, background .2s;
}
a.btn { color: inherit; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, .me-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost:hover, .btn.icon:hover { background: var(--accent-soft); }
.btn.icon { width: 44px; padding: 0; font-size: 1.2rem; }

input {
  width: 100%; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input::placeholder { color: var(--faint); }
label { display: grid; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.opt { font-weight: 400; }
.error { min-height: 1.3em; color: var(--accent); font-size: .9rem; }

/* 3D scene sits behind door and picker */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body.on-sheet #scene { display: none; }
#flurry { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
body.on-sheet #flurry { display: block; }
.sheet { z-index: 1; }
.screen { position: relative; }

/* Door */
#door { min-height: 100dvh; display: grid; align-items: end; padding: 16px; pointer-events: none; }
.door-card { pointer-events: auto; max-width: 30rem; padding: 2rem; display: grid; gap: 1rem; }
@media (min-width: 768px) { #door { align-items: center; padding: 0 0 0 7vw; } .door-card { padding: 2.5rem; } }
.door-date { display: flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--accent); }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: .95; letter-spacing: -.035em; font-weight: 800; }
.lede { color: var(--muted); line-height: 1.5; max-width: 34ch; }
#door-form { display: grid; gap: .5rem; margin-top: .5rem; }
.field-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.field-row input { flex: 1 1 10rem; }

/* Picker */
#pick { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); pointer-events: none; }
.pick-head { pointer-events: auto; }
.pick-head h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.pick-head p { color: var(--muted); margin-top: .25rem; }
@media (min-width: 768px) { #pick { padding: 40px 7vw 36px; } }
.pick-bar { pointer-events: auto; align-self: center; display: flex; align-items: center; gap: .5rem; padding: .5rem; border-radius: 999px; }
.pick-name { min-width: 8.5rem; text-align: center; font-weight: 800; font-size: 1.2rem; line-height: 1.1; display: grid; }
.pick-name small { font-size: .75rem; font-weight: 600; color: var(--faint); }

/* Outfit */
#outfit { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.outfit-card { width: min(100%, 26rem); padding: 1.5rem 1.1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; justify-items: center; text-align: center; }
.outfit-card h2 { font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; }
.outfit-card header p { color: var(--muted); margin-top: .25rem; }
.outfit-stage { position: relative; height: min(44dvh, 26rem); aspect-ratio: 1 / 2; }
.outfit-stage img, .outfit-stage canvas { position: absolute; display: block; }
#outfit-portrait { inset: 0; width: 100%; height: 100%; }
/* Wardrobe: slot tabs (a radio group styled as a segmented pill), then one scrollable row of round options per slot */
.slot-tabs { border: 0; margin: 0; min-width: 0; padding: 4px; display: flex; gap: 2px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); width: 100%; }
.slot-tabs label { position: relative; flex: 1; color: var(--muted); cursor: pointer; }
.slot-tabs span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 2px; border-radius: 999px; font-size: .7rem; font-weight: 600; transition: background .2s, color .2s; }
.slot-tabs i { font-size: 1.15rem; }
.slot-tabs input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.slot-tabs input:checked + span { background: var(--accent); color: var(--accent-ink); }
.slot-tabs input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#outfit-options { width: 100%; }
.outfit-options { border: 0; margin: 0; min-width: 0; padding: 4px 2px; display: flex; justify-content: safe center; gap: .3rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  --fade-l: 0px; --fade-r: 0px; mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent); }
.outfit-options::-webkit-scrollbar { display: none; }
.outfit-options.more-left { --fade-l: 32px; } /* edge fades say there is more to swipe to; set by app.js on scroll */
.outfit-options.more-right { --fade-r: 32px; }
.outfit-options label { position: relative; flex: none; width: 3.6rem; justify-items: center; align-content: start; gap: .3rem; font-size: .75rem; line-height: 1.15; cursor: pointer; scroll-snap-align: start; }
.outfit-options input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.swatch { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); font-size: 1.4rem; color: var(--faint); transition: transform .15s; }
.swatch { overflow: hidden; }
.swatch img { width: 38px; height: 38px; object-fit: contain; } /* fixed box: % sizes let tall art (pants) spill out */
.outfit-options input:checked + .swatch { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.outfit-options input:checked ~ * { color: var(--ink); }
.outfit-options input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.outfit-options label:active .swatch { transform: scale(.94); }
.outfit-actions { width: 100%; display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; }
/* Dark mode: the glass card sits over the bright snowy island, which washes it out; make it nearly solid there. */
@media (prefers-color-scheme: dark) { .outfit-card { background: rgb(13 23 38 / .9); } }
#outfit .error:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
#dress-up { background: var(--glass); }

/* Sheet */
.sheet { max-width: 1400px; margin: 0 auto; padding: 0 16px 64px; }
@media (min-width: 768px) { .sheet { padding: 0 32px 80px; } }
.top { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .45rem; font-weight: 800; letter-spacing: -.02em; }
.brand i { color: var(--accent); font-size: 1.2rem; }
.brand img { width: 30px; height: 30px; }
.me-chip { display: flex; align-items: center; gap: .55rem; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; font-weight: 600; }
.me-chip img { width: 36px; height: 36px; border-radius: 50%; background: var(--frost-1); }
.me-chip i { color: var(--faint); }

/* Sheet backdrop: two soft icy glows that stay put while the cards scroll */
body.on-sheet { background:
  radial-gradient(60% 50% at 100% 0%, var(--bg-2), transparent 70%) fixed,
  radial-gradient(50% 40% at 0% 100%, var(--frost-2), transparent 70%) fixed,
  var(--bg); }

.sheet-head { display: grid; gap: 12px; padding: .5rem 0 2rem; }
@media (min-width: 900px) { .sheet-head { grid-template-columns: 1.15fr 1fr; padding: 1rem 0 2.5rem; } }
.invite, .crowd { padding: 1.15rem 1.25rem; display: flex; flex-direction: column; }
@media (min-width: 768px) { .invite, .crowd { padding: 1.4rem 1.6rem; } }
.invite { position: relative; overflow: hidden; }
.invite::after { /* a big faint snowflake tucked in the corner */
  content: '\e5aa'; font-family: 'Phosphor'; position: absolute; right: -1.6rem; top: -1.6rem;
  font-size: 8rem; line-height: 1; color: var(--accent); opacity: .08; pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.count-days { margin-top: .35rem; font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.count-days #days { color: var(--accent); }
.details { list-style: none; margin: .9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.details li { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .95rem; }
.details img { width: 30px; height: 30px; flex: none; }
.head-actions { margin-top: auto; padding-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.rsvp { background: var(--glass); }
.rsvp.join { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.crowd-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .7rem; }
.crowd-faces { display: flex; flex-wrap: wrap; row-gap: 8px; padding-left: 12px; }
.crowd-faces .face { margin-left: -12px; }
.face { position: relative; width: 42px; height: 42px; transition: transform .2s; border-radius: 50%; background: var(--frost-1); border: 2.5px solid var(--bg); box-shadow: 0 4px 12px -6px rgb(40 70 110 / .5); }
@media (hover: hover) { .face:hover { transform: translateY(-4px); z-index: 1; } }
.face img { width: 100%; height: 100%; border-radius: 50%; }
.face.idle img { opacity: .55; } /* coming, nothing signed up yet: faded, not grey like "can't make it" */
.face b { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--bg); font-size: .7rem; display: grid; place-items: center; z-index: 2; /* above the next face, which overlaps it */ }
.crowd-note { margin-top: .6rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.away { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.away-label { font-size: .85rem; font-weight: 600; color: var(--faint); }
.crowd-faces.small .face { width: 30px; height: 30px; border-width: 2px; }
.crowd-faces.small .face img { filter: grayscale(1) opacity(.6); }

.board-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 1rem; }
.board { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .board { grid-template-columns: repeat(3, 1fr); } }
.col { position: relative; overflow: clip; /* clip: the watermark must not make the card scrollable */ display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem; border-radius: 20px; border: 1px solid var(--glass-line); background: var(--tint, var(--frost-1)); box-shadow: var(--shadow); transition: box-shadow .3s; }
.col:nth-child(3n+2) { --tint: var(--frost-2); }
.col:nth-child(3n) { --tint: var(--frost-3); }
.col > * { position: relative; }
.col .col-mark { position: absolute; right: -1.2rem; bottom: -1.6rem; font-size: 8.5rem; line-height: 1; color: var(--ink); opacity: .045; pointer-events: none; }
.col-head { display: flex; align-items: center; gap: .65rem; }
.col-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); font-size: 1.3rem; color: var(--accent); box-shadow: inset 0 0 0 1px var(--glass-line); }
.col-icon img { width: 46px; height: 46px; }
.col-head h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.col-count { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; background: var(--glass); color: var(--muted); font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.col.full .col-count { background: var(--accent); color: var(--accent-ink); }
.col.full { box-shadow: inset 0 0 0 1.5px var(--accent-soft), var(--shadow); }
.pips { display: flex; gap: 4px; color: var(--faint); font-size: .95rem; }
.pips .on { color: var(--accent); }
.items { list-style: none; margin: 0; padding: 0; display: grid; }
.item { display: grid; grid-template-columns: 44px 1fr auto; gap: .75rem; align-items: center; padding: .65rem .25rem; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item img { width: 44px; height: 44px; border-radius: 50%; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.item .what { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.item .meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.item .del { width: 44px; min-height: 44px; font-size: 1rem; border: 0; color: var(--faint); }
.item.mine .what::after { content: 'you'; margin-left: .45rem; padding: .1rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 600; vertical-align: .15em; }
.empty { display: flex; align-items: center; gap: .45rem; color: var(--faint); font-size: .92rem; padding: .4rem 0; }
.add { display: grid; gap: .7rem; overflow: hidden; padding: 1rem; border-radius: 20px; background: var(--glass); }
.add-row { display: flex; gap: .6rem; align-items: end; }
.add-row .grow { flex: 1; }
.add-row .serves { width: 6.5rem; }
.add-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.add-open { align-self: flex-start; background: var(--glass); }

.skeleton { min-height: 240px; border-radius: 20px; background: linear-gradient(100deg, var(--frost-1) 30%, var(--glass) 50%, var(--frost-1) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: .7rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s; }
.toast.show { opacity: 1; }
.toast.show.has-action { pointer-events: auto; }
.toast button { margin-left: .5rem; min-height: 44px; padding: 0 .9rem; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.toast.has-action { padding: .2rem .25rem .2rem 1.1rem; display: flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
