/* Noël à Plédran — paper collage / wrapping paper art direction. Mobile first, big & tactile. */
:root {
  --paper: #f4ecdb;
  --paper-2: #eadfc6;
  --kraft: #cfae7c;
  --kraft-2: #b98f58;
  --news: #e6e1d6;
  --ink: #1e2a22;
  --ink-soft: #4d5a52;
  --red: #c8202f;
  --red-2: #93141f;
  --green: #1f5c3f;
  --green-2: #134030;
  --gold: #dba43a;
  --white: #fffdf7;
  --tape: rgba(250, 232, 160, .78);
  --tape-2: rgba(200, 32, 47, .55);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'Cutive Mono', ui-monospace, monospace;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --drop: drop-shadow(3px 4px 0 rgba(30, 42, 34, .22)) drop-shadow(0 10px 14px rgba(30, 42, 34, .12));

  --wrap-candy: repeating-linear-gradient(-45deg, var(--red) 0 16px, var(--white) 16px 32px);
  --wrap-dots: radial-gradient(circle at 25% 25%, var(--white) 0 3.5px, transparent 4px) 0 0 / 22px 22px,
               radial-gradient(circle at 75% 75%, var(--gold) 0 3px, transparent 3.5px) 0 0 / 22px 22px, var(--green);
  --wrap-check: repeating-linear-gradient(0deg, rgba(255,255,255,.2) 0 9px, transparent 9px 18px),
                repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 9px, transparent 9px 18px), var(--red);
  --wrap-stars: radial-gradient(circle at 50% 50%, var(--gold) 0 2px, transparent 2.5px) 0 0 / 16px 16px, var(--red-2);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 18px; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 70% at 50% 0%, #fbf6ea 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, var(--paper-2) 0%, transparent 70%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.4;
}
[hidden] { display: none !important; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--mono); }
.hand { font-family: var(--hand); font-size: 1.6rem; font-weight: 700; margin: 0; color: var(--ink); line-height: 1.1; }
.small { font-size: 1.25rem; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .28; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0 0.3 0 0 0 1.2 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.screen { position: relative; z-index: 1; min-height: 100dvh; }

/* ---------- Paper stocks ---------- */
.p-white { background: var(--white); }
.p-note {
  background:
    linear-gradient(90deg, transparent 34px, rgba(200, 32, 47, .45) 34px 36px, transparent 36px),
    repeating-linear-gradient(180deg, transparent 0 29px, rgba(60, 110, 180, .22) 29px 30px),
    #fffdf5;
}
.p-grid {
  background:
    repeating-linear-gradient(0deg, rgba(31, 92, 63, .13) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(31, 92, 63, .13) 0 1px, transparent 1px 16px),
    #f6faf3;
}
.p-kraft {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.06), transparent 45%),
    var(--kraft);
}
.p-news {
  background:
    radial-gradient(circle, rgba(30,42,34,.12) 1px, transparent 1.4px) 0 0 / 6px 6px,
    var(--news);
}

/* Torn paper: clip-path polygon generated per element in JS (--torn) */
.scrap { position: relative; filter: var(--drop); transform: rotate(var(--rot, 0deg)); }
.scrap > .paper { clip-path: var(--torn, none); }
.tape {
  position: absolute; z-index: 3; width: 92px; height: 26px; top: -12px; left: 50%; margin-left: -46px;
  background: var(--tape); transform: rotate(var(--trot, -4deg));
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 20% 0, 30% 8%, 40% 0, 50% 6%, 60% 0, 70% 10%, 80% 0, 90% 8%, 100% 0, 100% 92%, 94% 100%, 86% 90%, 76% 100%, 66% 92%, 56% 100%, 46% 90%, 36% 100%, 26% 92%, 16% 100%, 8% 90%, 0 100%);
}
.tape.red { background: var(--tape-2); }

/* ---------- Ransom letters (cut from magazines) ---------- */
.ransom { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 5px; margin: 0; line-height: 1; }
.rl {
  display: inline-grid; place-items: center; min-width: .9em; padding: .08em .14em .04em;
  transform: rotate(var(--r)); filter: drop-shadow(2px 3px 0 rgba(30,42,34,.25));
  clip-path: var(--c);
}
.rl.sp { min-width: .35em; padding: 0; filter: none; }
.ransom.anim .rl { animation: drop-in .8s var(--ease-out) backwards; animation-delay: var(--d); }
.rl.v0 { background: var(--red); color: var(--white); font-family: var(--serif); font-style: italic; }
.rl.v1 { background: var(--wrap-dots); color: var(--white); font-family: var(--sans); font-weight: 800; text-shadow: 2px 2px 0 var(--green-2); }
.rl.v2 { background: var(--kraft); color: var(--red-2); font-family: var(--serif); }
.rl.v3 { background: var(--white); color: var(--green); font-family: var(--mono); outline: 3px dashed var(--red); outline-offset: -6px; }
.rl.v4 { background: var(--news); color: var(--ink); font-family: var(--sans); font-weight: 800; }
.rl.v5 { background: var(--gold); color: var(--ink); font-family: var(--serif); font-style: italic; }
.rl.v6 { background: var(--ink); color: var(--paper); font-family: var(--mono); }
.ransom.big .rl { font-size: clamp(78px, 23vw, 150px); }
.ransom.mid .rl { font-size: clamp(40px, 11vw, 70px); }
.ransom.sm { justify-content: flex-start; }
.ransom.sm .rl { font-size: clamp(36px, 9vw, 58px); }

@keyframes rise { from { opacity: 0; transform: translateY(26px) rotate(var(--rot, 0deg)); } to { opacity: 1; transform: rotate(var(--rot, 0deg)); } }
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-50px) rotate(calc(var(--r, 0deg) * -4)) scale(1.4); }
  60% { opacity: 1; transform: translateY(5px) rotate(var(--r, 0deg)) scale(.97); }
  100% { opacity: 1; transform: rotate(var(--r, 0deg)); }
}

/* ---------- Gate ---------- */
#gate { display: grid; place-items: center; padding: 36px 16px 48px; text-align: center; overflow: hidden; }
.gate-inner { width: min(520px, 100%); position: relative; z-index: 2; }
.eyebrow { margin: 0 0 16px; opacity: 0; animation: rise .8s .1s var(--ease-out) forwards; }
.eyebrow span { font-family: var(--mono); font-size: 1rem; letter-spacing: .1em; display: inline-block; padding: 6px 14px; background: var(--tape); transform: rotate(-2deg); }
.ransom-title { margin: 0; display: grid; justify-items: center; gap: 4px; }
.strip {
  display: inline-block; margin-top: 10px; padding: 8px 22px 10px; font-family: var(--serif); font-size: clamp(44px, 13vw, 72px); line-height: 1;
  background: radial-gradient(circle, rgba(30,42,34,.14) 1px, transparent 1.4px) 0 0 / 6px 6px, var(--news);
  transform: rotate(-2.5deg); filter: drop-shadow(3px 4px 0 rgba(30,42,34,.22));
  clip-path: polygon(0 10%, 4% 0, 9% 8%, 15% 2%, 22% 9%, 30% 1%, 38% 8%, 46% 0, 55% 7%, 63% 1%, 71% 9%, 79% 2%, 87% 8%, 94% 0, 100% 9%, 99% 88%, 95% 100%, 88% 92%, 80% 99%, 72% 91%, 63% 100%, 55% 92%, 46% 99%, 38% 91%, 29% 100%, 21% 92%, 13% 99%, 6% 91%, 1% 100%);
  opacity: 0; animation: rise .8s .7s var(--ease-out) forwards; --rot: -2.5deg;
}
.strip em { color: var(--red); }
.where { white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; font-family: var(--mono); font-size: 1rem;
  padding: 6px 12px; border: 2px solid var(--ink); border-radius: 4px; transform: rotate(1.5deg);
  opacity: 0; animation: rise .8s .85s var(--ease-out) forwards; --rot: 1.5deg;
}
.ermine { width: 14px; height: 20px; color: var(--ink); }
.kenavo { font-family: var(--hand); font-size: 2.1rem; color: var(--green); margin: 10px 0 0; transform: rotate(-3deg); opacity: 0; animation: rise .8s 1s var(--ease-out) forwards; --rot: -3deg; }
.countdown { font-size: 1.1rem; margin: 6px 0 0; opacity: 0; animation: rise .8s 1.1s var(--ease-out) forwards; }
.countdown strong { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2em; color: var(--red); vertical-align: -4px; }

.doodles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.dd { position: absolute; width: 64px; height: 64px; filter: url(#boil); opacity: 0; animation: rise 1s var(--ease-out) forwards, float 7s ease-in-out infinite; }
.dd-1 { top: 6%; left: 5%; color: var(--gold); animation-delay: 1.1s, 1.1s; }
.dd-2 { top: 10%; right: 6%; color: var(--green); width: 76px; height: 76px; animation-delay: 1.2s, 2s; }
.dd-3 { bottom: 10%; left: 3%; color: var(--green); width: 100px; height: 76px; animation-delay: 1.3s, 0s; }
.dd-4 { bottom: 5%; right: 5%; color: var(--red); width: 130px; height: 32px; animation-delay: 1.4s, 1s; }
.dd-5 { top: 40%; left: 4%; color: var(--ink); width: 30px; height: 46px; animation-delay: 1.5s, 3s; }
.dd-6 { top: 44%; right: 3%; color: var(--green); width: 56px; height: 66px; animation-delay: 1.6s, .5s; }
@keyframes float { 50% { translate: 0 -10px; } }

.gift { position: relative; width: 150px; height: 144px; margin: 26px auto 20px; opacity: 0; animation: rise .9s 1.2s var(--ease-out) forwards; }
.gift-box {
  position: absolute; bottom: 0; left: 10px; right: 10px; height: 96px;
  background: linear-gradient(90deg, transparent 43%, var(--green) 43% 57%, transparent 57%), var(--wrap-candy);
  filter: var(--drop); clip-path: polygon(0 2%, 100% 0, 99% 100%, 1% 98%);
}
.gift-lid {
  position: absolute; top: 18px; left: 0; right: 0; height: 34px; z-index: 2;
  background: linear-gradient(90deg, transparent 43%, var(--green) 43% 57%, transparent 57%), var(--wrap-candy);
  box-shadow: 0 5px 0 rgba(30,42,34,.18); transform-origin: 20% 100%;
  animation: wiggle 3.2s 2.4s ease-in-out infinite;
}
.bow { position: absolute; left: 50%; top: -26px; width: 0; height: 0; filter: url(#boil); }
.bow span { position: absolute; top: 0; width: 34px; height: 28px; border: 8px solid var(--green); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.bow span:first-child { right: 0; transform: rotate(-20deg); }
.bow span:last-child { left: 0; transform: rotate(20deg); }
.gift-glow { position: absolute; inset: 30% 10%; background: radial-gradient(closest-side, rgba(255, 214, 120, 1), transparent); opacity: 0; z-index: 1; }
@keyframes wiggle { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-5deg) translateY(-4px); } 95% { transform: rotate(4deg) translateY(-2px); } }
.gift.open .gift-lid { animation: lid-off .9s var(--ease-out) forwards; }
.gift.open .gift-glow { animation: glow 1.1s ease-out forwards; }
@keyframes lid-off { to { transform: translate(90px, -150px) rotate(48deg); opacity: 0; } }
@keyframes glow { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(2.6); } 100% { opacity: 0; transform: scale(4.5); } }
.gift.shake { opacity: 1; animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px) rotate(-4deg); } 40%, 80% { transform: translateX(8px) rotate(4deg); } }

.tag-form {
  position: relative; display: grid; gap: 12px; text-align: left; padding: 24px 22px 18px 44px;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.2), transparent 45%), var(--kraft);
  filter: var(--drop); --rot: -1.2deg; transform: rotate(-1.2deg);
  clip-path: polygon(0 10%, 7% 0, 100% 0, 99% 30%, 100% 62%, 99% 100%, 7% 100%, 0 90%);
  opacity: 0; animation: rise .9s 1.35s var(--ease-out) forwards;
}
.tag-hole { position: absolute; left: 16px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--paper); box-shadow: inset 1px 1px 0 rgba(0,0,0,.25); }
.tag-form label { font-family: var(--hand); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.error { color: var(--red-2); min-height: 1.3em; font-size: 1rem; margin: 0; font-family: var(--mono); }

input, textarea {
  font: inherit; font-size: 1.1rem; color: var(--ink); width: 100%; min-width: 0; min-height: 56px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 6px;
  padding: 12px 16px; outline: none; transition: box-shadow .2s, transform .2s;
}
textarea { min-height: 0; }
input:focus, textarea:focus { box-shadow: 4px 4px 0 var(--red); transform: translate(-2px, -2px); }
input::placeholder, textarea::placeholder { color: #9a9a8c; }

.btn {
  font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; border: 3px solid var(--ink); border-radius: 6px;
  min-height: 52px; padding: 10px 18px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 4px 4px 0 var(--ink); background: var(--white); color: var(--ink); text-decoration: none;
  transition: transform .18s var(--ease-spring), box-shadow .18s;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 5px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-xl { min-height: 60px; font-size: 1.2rem; width: 100%; }
.btn-red { background: var(--red); color: var(--white); }
.btn-green { background: var(--green); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--ink); }
.danger { color: var(--red); }

/* ---------- Who ---------- */
#who { display: grid; place-items: center; padding: 40px 16px 60px; }
.who-inner { width: min(680px, 100%); text-align: center; display: grid; gap: 14px; }
.who-inner > .hand { transform: rotate(-2deg); color: var(--green); font-size: 2rem; }
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 18px; margin: 18px 0 26px; }
.person-btn { font: inherit; color: var(--ink); cursor: pointer; border: 0; padding: 0; background: none; animation: drop-in .7s var(--ease-out) backwards; }
.person-btn .paper { display: grid; gap: 4px; justify-items: center; padding: 26px 10px 20px; }
.person-btn .emo { font-size: 3.2rem; line-height: 1; }
.person-btn .nm { font-family: var(--serif); font-size: 2rem; line-height: 1; }
.person-btn:active .scrap { transform: rotate(0) scale(.96); }
.scrap-form { position: relative; display: grid; gap: 14px; padding: 26px 20px 22px; background: var(--white); filter: var(--drop); transform: rotate(.6deg);
  clip-path: polygon(0 2%, 8% 0, 22% 2%, 40% 0, 60% 2%, 78% 0, 92% 2%, 100% 0, 99% 50%, 100% 100%, 85% 98%, 65% 100%, 45% 98%, 25% 100%, 5% 98%, 0 100%, 1% 50%); }
.emoji-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.emoji-pick button { font-size: 2rem; width: 58px; height: 58px; background: transparent; border: 3px solid transparent; border-radius: 50%; cursor: pointer; transition: transform .2s var(--ease-spring); }
.emoji-pick button[aria-pressed="true"] { border-color: var(--red); background: rgba(200, 32, 47, .08); transform: scale(1.12) rotate(-6deg); }

/* ---------- App ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: var(--paper); border-bottom: 3px solid var(--ink);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -13px; height: 10px; background: var(--wrap-candy); }
.brand { display: grid; line-height: .9; }
.brand em { font-size: 2.1rem; color: var(--red); }
.brand .mono { font-size: .8rem; letter-spacing: .06em; }
.days { margin-left: auto; font-family: var(--mono); font-size: .85rem; text-align: right; line-height: 1; }
.days strong { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2rem; color: var(--green); }
.me-chip {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--white); border: 3px solid var(--ink); border-radius: 999px;
  min-height: 50px; padding: 4px 14px 4px 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; box-shadow: 3px 3px 0 var(--ink);
}
.me-chip .emo { font-size: 1.6rem; }

.tabs { display: flex; gap: 12px; overflow-x: auto; padding: 30px 14px 12px; scrollbar-width: none; max-width: 1240px; margin: 0 auto; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--ink); cursor: pointer; flex: none; display: flex; align-items: center; gap: 8px;
  min-height: 58px; background: var(--white); border: 3px solid var(--ink); padding: 6px 16px 6px 10px; border-radius: 6px;
  transform: rotate(var(--rot, 0deg)); transition: transform .25s var(--ease-spring); scroll-snap-align: start;
}
.tab:nth-child(odd) { --rot: -1.5deg; }
.tab:nth-child(even) { --rot: 1.2deg; }
.tab .emo { font-size: 1.8rem; }
.tab .count { font-family: var(--mono); font-size: .9rem; background: var(--paper-2); border-radius: 999px; padding: 1px 9px; }
.tab[aria-selected="true"] { background: var(--wrap-check); color: var(--white); box-shadow: 4px 4px 0 var(--ink); transform: rotate(0) translateY(-3px); text-shadow: 1px 1px 0 var(--red-2); }
.tab[aria-selected="true"] .count { background: var(--white); color: var(--ink); text-shadow: none; }
.tab.cart[aria-selected="true"] { background: var(--green); text-shadow: none; }

.board { position: relative; z-index: 1; padding: 4px 14px 140px; max-width: 1240px; margin: 0 auto; }
.board.calm * { animation: none !important; }
.list-head { display: grid; gap: 10px; margin: 14px 0 8px; }
.list-head .meta { font-family: var(--hand); font-size: 1.7rem; font-weight: 700; color: var(--green); transform: rotate(-1.5deg); justify-self: start; }

.notice {
  position: relative; display: block; margin: 10px 0 30px; padding: 14px 16px; font-size: 1.05rem; max-width: 720px;
  background: var(--tape); transform: rotate(-.8deg);
  clip-path: polygon(0 4%, 3% 0, 97% 2%, 100% 0, 99% 96%, 100% 100%, 2% 98%, 0 100%);
}

.items { display: grid; grid-template-columns: 1fr; gap: 34px; }

/* Card: a torn scrap taped on the page */
.card-wrap { animation: drop-in .7s var(--ease-out) backwards; }
.card { position: relative; padding: 26px 20px 20px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.card.p-note { padding-left: 48px; }
.card-wrap .scrap { height: 100%; transition: transform .35s var(--ease-spring); }
@media (hover: hover) { .card-wrap:hover .scrap { transform: rotate(0deg) translateY(-4px); } }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: .9rem; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,.6); }
.secret-tag { background: var(--ink); color: var(--paper); }
.price {
  margin-left: auto; font-family: var(--serif); font-size: 2.1rem; line-height: 1; color: var(--white);
  background: var(--green); padding: 4px 12px 6px; transform: rotate(3deg);
  clip-path: polygon(0 6%, 100% 0, 97% 100%, 3% 94%);
}
.card h3 { margin: 0; font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.card .notes { margin: 0; font-family: var(--hand); font-size: 1.5rem; font-weight: 600; color: var(--ink-soft); line-height: 1.1; }
.card .by { font-family: var(--mono); font-size: .95rem; color: var(--ink-soft); margin: 0; }
.hearts { font-size: 1.5rem; letter-spacing: 4px; line-height: 1; }
.hearts .on { color: var(--red); }
.hearts .off { color: rgba(30,42,34,.15); }
.card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }

.stamp {
  position: absolute; right: 14px; top: 46%; z-index: 4; pointer-events: none;
  font-family: var(--mono); font-weight: 700; font-size: 1.5rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 12px; border: 4px solid currentColor; border-radius: 8px; transform: rotate(-12deg);
  mix-blend-mode: multiply; opacity: .85; animation: stamp .45s var(--ease-spring) backwards;
}
.stamp.reserved { color: #b07a10; }
.stamp.bought { color: var(--green); }
.stamp.wrapped { color: var(--red); }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(2.4); } }
.card-wrap.by-other { opacity: .72; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; }
.steps button {
  font: inherit; font-size: 1rem; font-weight: 700; min-height: 54px; padding: 6px 4px; border: 0; cursor: pointer; background: var(--white); color: var(--ink);
  border-right: 3px solid var(--ink); transition: background .2s;
}
.steps button:last-child { border-right: 0; }
.steps button.done { background: var(--green); color: var(--white); }
.steps button.current.s-wrapped { background: var(--red); }

.empty { text-align: center; padding: 50px 20px; font-family: var(--hand); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.empty svg { width: 110px; height: 110px; color: var(--green); filter: url(#boil); display: block; margin: 0 auto 14px; }

.fab { position: fixed; left: 14px; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 12; min-height: 62px; font-size: 1.2rem; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 10px; }
.total-card { display: grid; padding: 14px 10px; text-align: center; }
.total-card .k { font-family: var(--mono); font-size: .85rem; }
.total-card .v { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; }
.owner-head { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 2.3rem; font-weight: 400; margin: 34px 0 20px; }
.owner-head em { color: var(--red); }

/* ---------- Dialog: full screen sheet on phones ---------- */
dialog {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 94dvh;
  background: var(--paper); color: var(--ink); border-top: 4px solid var(--ink); border-radius: 18px 18px 0 0;
}
dialog[open] { animation: sheet .45s var(--ease-out); }
dialog::backdrop { background: rgba(30, 42, 34, .5); }
@keyframes sheet { from { transform: translateY(100%); } }
.item-form { padding: 24px 18px max(22px, env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.item-form h3 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 2.6rem; margin: 0; color: var(--red); line-height: 1; }
.item-form label { display: grid; gap: 6px; font-size: 1rem; font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.envie { border: 0; padding: 0; margin: 0; }
.envie legend { font-size: 1rem; font-weight: 700; margin-bottom: 4px; padding: 0; }
.stars { display: flex; gap: 2px; }
.stars button { font-size: 2.4rem; width: 56px; height: 56px; background: none; border: 0; cursor: pointer; color: rgba(30,42,34,.18); transition: transform .2s var(--ease-spring), color .2s; padding: 0; }
.stars button.on { color: var(--red); }
.stars button:active { transform: scale(1.3) rotate(-8deg); }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.form-actions .btn-xl { grid-column: 1 / -1; }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 60; transform: translate(-50%, 20px) rotate(-2deg); opacity: 0;
  background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 1.05rem; padding: 12px 20px;
  transition: opacity .3s, transform .4s var(--ease-spring); pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }

.burst { position: fixed; pointer-events: none; z-index: 70; width: 26px; height: 26px; margin: -13px 0 0 -13px; animation: burst 1.2s var(--ease-out) forwards; }
.burst svg { width: 100%; height: 100%; display: block; }
@keyframes burst { 0% { transform: scale(.3); } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 0; } }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 640px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .items { grid-template-columns: repeat(2, 1fr); gap: 40px 30px; }
  .board, .tabs { padding-left: 28px; padding-right: 28px; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .brand { display: flex; align-items: baseline; gap: 10px; }
  .brand em { font-size: 2.5rem; }
  .brand .mono { font-size: 1rem; }
  .fab { left: auto; right: 28px; bottom: 24px; width: auto; padding: 10px 28px; }
  .list-head { grid-template-columns: 1fr auto; align-items: end; }
  dialog { margin: auto; width: min(580px, calc(100% - 32px)); border: 4px solid var(--ink); border-radius: 8px; box-shadow: 8px 8px 0 var(--ink); }
  dialog[open] { animation: pop .45s var(--ease-spring); }
  @keyframes pop { from { opacity: 0; transform: rotate(-3deg) scale(.9) translateY(14px); } }
  .form-actions { grid-template-columns: auto auto 1fr; }
  .form-actions .btn-xl { grid-column: auto; order: 3; justify-self: end; width: auto; }
  .totals { max-width: 640px; }
}
@media (min-width: 1100px) {
  .items { grid-template-columns: repeat(3, 1fr); }
  .dd { width: 90px; height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .dd, .bow, .empty svg { filter: none; }
}
