:root {
  --bg: #FBF6EE; --card: #FFFFFF; --ink: #1E2A24; --muted: #66706A; --line: #E7DED0;
  --green: #1F4D3A; --green-2: #2D6B51; --red: #C8402F; --gold: #F2C14E; --soft: #F3ECE0;
  --radius: 18px; --shadow: 0 1px 2px rgba(30,42,36,.06), 0 8px 24px rgba(30,42,36,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111814; --card: #1A231E; --ink: #EEE9DF; --muted: #A2ABA5; --line: #2C3832;
    --green: #8FCFAE; --green-2: #A9DDC1; --red: #F07A66; --soft: #222D27; color-scheme: dark;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3, .serif { font-family: ui-serif, "New York", Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.08; margin: 0 0 12px; }
h2 { font-size: 22px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--green-2); }
.top { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; }
.brand img { border-radius: 8px; }
main { width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; flex: 1; }
.foot { max-width: 560px; margin: 0 auto; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.lead { font-size: 18px; color: var(--muted); }

.btn { appearance: none; border: 0; border-radius: 999px; padding: 14px 20px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #0F1A14; } }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--green-2); border: 1.5px solid var(--line); }
.btn.red { background: var(--red); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px; }
textarea { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 6px 6px 6px 14px; font-weight: 600; }
.chip button { border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.chip button:hover { background: var(--line); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: #DDEFE5; color: #1F4D3A; }
@media (prefers-color-scheme: dark) { .pill.ok { background: #24412F; color: #A9DDC1; } }

.who { width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; font: inherit; color: var(--ink); display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 60px; }
.who:hover:not(:disabled) { border-color: var(--green-2); }
.who:disabled { opacity: .5; cursor: default; }
.whos { display: grid; gap: 10px; }

.copybox { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 12px; padding: 6px 6px 6px 12px; }
.copybox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* La chaussette à ouvrir */
.reveal { text-align: center; padding: 28px 18px; position: relative; overflow: hidden; }
.sock { width: 150px; height: 190px; margin: 8px auto 16px; display: block; cursor: pointer; border: 0; background: none; padding: 0; transition: transform .2s; }
.sock:hover { transform: rotate(-4deg); }
.sock.shake { animation: shake .6s ease-in-out; }
@keyframes shake { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-10deg) } 40% { transform: rotate(9deg) } 60% { transform: rotate(-6deg) } 80% { transform: rotate(4deg) } }
.name-big { font-family: ui-serif, Georgia, serif; font-size: clamp(40px, 12vw, 60px); line-height: 1; color: var(--red); margin: 6px 0 10px; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.confetti { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(420px) rotate(540deg); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .confetti, .sock.shake, .name-big { animation: none; } }

.facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.wish { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.wish:first-child { border-top: 0; }
.wish .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-top: 9px; flex: none; }
.wish a { word-break: break-word; }
.empty { text-align: center; padding: 18px; color: var(--muted); background: var(--soft); border-radius: 12px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; margin: 12px 0; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
@media (prefers-color-scheme: dark) { .steps li::before { color: #0F1A14; } }
.error { color: var(--red); font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; transition: transform .25s; max-width: calc(100% - 32px); z-index: 10; }
#toast.on { transform: translate(-50%, 0); }
.hidden { display: none !important; }
.who .grow, .list .grow { flex: 1; min-width: 0; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.cat:active { transform: scale(.95); }
.cat.on { background: var(--green); border-color: var(--green); color: var(--bg); }
.cat.on::after { content: '✓'; font-weight: 800; }
.cat.static { cursor: default; }
.cat.static::after { content: none; }
