:root {
  /* Nuit de Noël : ciel bleu nuit, neige crème, rouge houx, vert sapin, or des guirlandes */
  --night-1: #07142A;
  --night-2: #0E2A47;
  --night-3: #16435A;
  --cream: #FBF5EA;
  --paper: #FFFDF8;
  --card: #FFFFFF;
  --line: #EADFCB;
  --ink: #1E2B28;
  --muted: #5B6661;
  --red: #C8322B;
  --red-d: #A32520;
  --green: #1B6144;
  --green-d: #134A33;
  --gold: #E8B04A;
  --gold-d: #9A6A12;
  --blue: #2F7FB0;
  --accent: var(--red);
  --soft: #FCE9E6;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Nunito', cursive;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.page { max-width: 1112px; margin: 0 auto; padding: 0 16px; }

/* ----- en-tête : la nuit de Noël ----- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  padding-bottom: clamp(120px, 17vw, 210px);
  background:
    radial-gradient(52rem 30rem at 86% 12%, rgba(232, 176, 74, 0.26), transparent 62%),
    radial-gradient(44rem 28rem at 6% 96%, rgba(47, 127, 176, 0.42), transparent 66%),
    linear-gradient(180deg, var(--night-1), var(--night-2) 55%, var(--night-3));
}
.hero::before { /* étoiles */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.75;
  background-image:
    radial-gradient(1.6px 1.6px at 24px 38px, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 140px 96px, #FFE9B8, transparent 60%),
    radial-gradient(1px 1px at 86px 170px, #fff, transparent 60%),
    radial-gradient(1.4px 1.4px at 196px 22px, #fff, transparent 60%),
    radial-gradient(1px 1px at 232px 142px, #CFE6FF, transparent 60%),
    radial-gradient(1.2px 1.2px at 300px 70px, #fff, transparent 60%);
  background-size: 260px 210px, 330px 250px, 290px 230px, 410px 190px, 370px 270px, 450px 310px;
}
#snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lights { position: relative; z-index: 1; display: flex; justify-content: center; height: 70px; overflow: hidden; }
.lights svg { flex: none; width: 160px; height: 70px; display: block; }
.bulb ellipse { filter: drop-shadow(0 0 7px var(--c)); }

.hero-inner { position: relative; z-index: 1; max-width: 1112px; margin: 0 auto; padding: clamp(4px, 2vw, 28px) 20px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(8px, 3vw, 40px); }
.dear { display: inline-block; margin: 0 0 4px; font-family: var(--hand); font-weight: 700; font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1; color: var(--gold); transform: rotate(-3deg); transform-origin: left bottom; }
h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 8.6vw, 5.6rem); line-height: 0.96; letter-spacing: -0.02em; color: #FFF8EA; text-wrap: balance; text-shadow: 0 2px 30px rgba(7, 20, 42, 0.6); }
h1 em { font-style: italic; font-weight: 600; color: var(--gold); text-shadow: 0 0 34px rgba(232, 176, 74, 0.55); }
.lede { margin: clamp(10px, 2vw, 18px) 0 0; max-width: 30ch; font-size: clamp(1rem, 2.2vw, 1.2rem); font-weight: 500; color: #D6E4EE; }
.tree-wrap { position: relative; flex: none; width: clamp(104px, 27vw, 270px); }
.tree-wrap::before { content: ''; position: absolute; inset: -18% -22% -6%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 130, 0.42), rgba(255, 214, 130, 0.1) 60%, transparent); }
.tree { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 26px rgba(4, 12, 28, 0.55)); }
.hills { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; height: clamp(70px, 11vw, 150px); display: block; }

/* ----- la lettre au Père Noël ----- */
.intro { position: relative; z-index: 2; }
.letter {
  position: relative; max-width: 780px; margin: calc(-1 * clamp(84px, 12vw, 150px)) auto 0; padding: 8px; border-radius: 22px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 12px, #fff 12px 24px, var(--green) 24px 36px, #fff 36px 48px);
  box-shadow: 0 30px 60px -24px rgba(7, 20, 42, 0.6), 0 4px 12px -4px rgba(7, 20, 42, 0.25);
  transform: rotate(-0.8deg);
}
.letter-in { background: var(--paper); border-radius: 15px; padding: 22px 26px 14px; font-family: var(--hand); font-size: 1.72rem; line-height: 1.22; }
.letter-in::after { content: ''; display: block; clear: both; }
.letter p { margin: 0; }
.letter .sign { margin-top: 4px; text-align: right; font-weight: 700; font-size: 2.1rem; color: var(--red); }
.stamp { float: right; width: 74px; height: auto; margin: -4px -6px 6px 16px; transform: rotate(5deg); filter: drop-shadow(0 3px 5px rgba(30, 43, 40, 0.25)); }

.how { margin: 30px 0 0; padding: 0; list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how li { counter-increment: how; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 16px 16px 66px; font-size: 0.98rem; line-height: 1.4; box-shadow: 0 10px 24px -20px rgba(60, 40, 10, 0.5); }
.how li::before { content: counter(how); position: absolute; left: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(160deg, #F5C76B, #D9952A); color: #3A2600; font-family: var(--display); font-weight: 800; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 6px 12px -6px rgba(185, 127, 28, 0.9); }
.how strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.12rem; color: var(--green); }

/* ----- barre collante : rubriques, filtre, avancement ----- */
.bar { position: -webkit-sticky; position: sticky; top: 0; z-index: 20; margin-top: 30px; background: rgba(251, 245, 234, 0.88); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1112px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.chips { flex: 1 1 420px; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px -16px; padding: 4px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 99px; min-height: 40px; padding: 6px 15px; font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chip:hover { border-color: #CDBE9F; }
.chip.toggle { border-style: dashed; border-color: #BFAF8E; }
.chip.toggle[aria-pressed="true"] { border-style: solid; border-color: var(--green); background: var(--green); color: #fff; }
.progress { flex: 1 1 230px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.progress-label { margin: 0; font-size: 0.86rem; font-weight: 800; color: var(--green-d); }
.track { height: 9px; border-radius: 99px; background: #EBE1CE; overflow: hidden; }
.track span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), #3FA676 60%, var(--gold)); }

.status { margin: 22px 0 0; font-weight: 700; color: var(--muted); text-align: center; }
.status.error { color: var(--red); }
.status:empty { display: none; }
.empty { margin: 48px auto; max-width: 30ch; text-align: center; font-family: var(--display); font-weight: 600; font-style: italic; font-size: 1.5rem; color: var(--green); }

/* ----- rubriques et cartes ----- */
.a0 { --accent: #C8322B; --soft: #FCEAE7; }
.a1 { --accent: #2F7FB0; --soft: #E5F1F8; }
.a2 { --accent: #D9952A; --soft: #FBF0DA; }
.a3 { --accent: #1B6144; --soft: #E4F1EA; }
.section { scroll-margin-top: 110px; padding-top: 44px; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-head::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), transparent); opacity: 0.35; }
.section h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 4.6vw, 2.4rem); line-height: 1.05; letter-spacing: -0.01em; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.section h2 svg { flex: none; width: 38px; height: 44px; }
.count { flex: none; order: 2; padding: 3px 12px; border-radius: 99px; background: var(--soft); font-size: 0.82rem; font-weight: 800; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }

.card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px 20px 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 34px -26px rgba(60, 40, 10, 0.55), 0 2px 6px -3px rgba(60, 40, 10, 0.12); }
.card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--accent); }
.card.is-taken { border-color: #BFDCCD; background: linear-gradient(180deg, #F4FAF6, #fff 140px); }
.card.is-taken::before { background: linear-gradient(90deg, var(--green), #3FA676); }
.card.is-locked { background: repeating-linear-gradient(135deg, #FBF7EF 0 14px, #F7F1E5 14px 28px); border-style: dashed; border-color: #D9CBAE; box-shadow: none; }
.card.is-locked::before { background: #D9CBAE; }
.card-head { display: flex; align-items: center; gap: 14px; }
.icon { position: relative; flex: none; width: 70px; height: 70px; border-radius: 22px; background: var(--soft); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); box-shadow: 0 0 0 1px rgba(30, 43, 40, 0.05) inset, 0 8px 14px -10px rgba(30, 43, 40, 0.5); }
.icon svg { width: 48px; height: 48px; }
.is-taken .card-head .icon::after { content: ''; position: absolute; right: -7px; bottom: -7px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.is-locked .icon { filter: grayscale(0.75); opacity: 0.7; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.36rem; line-height: 1.12; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; padding: 2px 10px; border-radius: 99px; background: var(--soft); color: var(--ink); font-size: 0.76rem; font-weight: 800; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.desc { margin: 0; }
.examples { margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: 0.9rem; line-height: 1.42; color: #3A4541; }
.state { margin: 0; display: inline-flex; align-self: flex-start; align-items: center; gap: 7px; padding: 4px 13px; border-radius: 99px; font-size: 0.85rem; font-weight: 800; background: #F3ECDD; color: var(--muted); }
.state::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.is-taken .state { background: var(--green); color: #fff; }
.is-taken .state::before { background: #fff; border-color: #fff; }
.locked-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; color: var(--muted); }
.locked-note svg { flex: none; width: 18px; height: 18px; }

.taken-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.taken-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 11px; align-items: start; background: #F1F8F4; border: 1px solid #D3E7DC; border-radius: 16px; padding: 10px 12px; }
.avatar { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(160deg, #2A8059, var(--green-d)); color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; }
.who { margin: 0; overflow-wrap: anywhere; line-height: 1.35; }
.who strong { color: var(--green-d); }
.row-actions { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; }
.link { appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 6px 0; min-height: 34px; font: inherit; font-size: 0.9rem; font-weight: 800; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: var(--red-d); }
.phone { font-weight: 800; color: var(--ink); padding: 6px 0; }

.card .btn { margin-top: auto; }
.btn { appearance: none; -webkit-appearance: none; border: 0; border-radius: 15px; min-height: 52px; padding: 10px 20px; background: linear-gradient(180deg, #D8413A, #B82A24); color: #fff; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-align: center; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 12px 20px -12px rgba(184, 42, 36, 0.95); }
.btn svg { flex: none; width: 20px; height: 20px; }
.btn:hover { background: linear-gradient(180deg, #C9362F, #A32520); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--green-d); box-shadow: inset 0 0 0 2px var(--green); }
.btn.secondary:hover { background: #F1F8F4; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px #D9CDB6; }
.btn.ghost:hover { background: #F6EFE1; }
.btn:disabled { background: #EAE2D2; color: #7C7768; box-shadow: none; cursor: not-allowed; transform: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ----- pied de page ----- */
.foot { position: relative; margin-top: 72px; padding: clamp(96px, 13vw, 160px) 20px 44px; text-align: center; color: #D6E4EE; background: linear-gradient(180deg, var(--night-3), var(--night-2) 45%, var(--night-1)); overflow: hidden; }
.foot .wave { position: absolute; left: 0; right: 0; top: -1px; width: 100%; height: clamp(50px, 8vw, 110px); display: block; }
.foot p { position: relative; margin: 0; }
.foot .love { font-family: var(--hand); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.1; color: var(--gold); }
.foot .small { margin-top: 6px; font-size: 0.9rem; }

/* ----- fenêtre de réservation ----- */
dialog { width: min(100% - 24px, 480px); max-height: calc(100% - 24px); border: 0; border-radius: 26px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(7, 20, 42, 0.55); overflow: auto; }
dialog::backdrop { background: rgba(7, 20, 42, 0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.dlg-head { display: flex; align-items: center; gap: 14px; padding: 20px; color: #fff; background: radial-gradient(18rem 10rem at 100% 0, rgba(232, 176, 74, 0.3), transparent 70%), linear-gradient(135deg, var(--night-2), var(--night-3)); }
.dlg-head .icon { width: 60px; height: 60px; border-radius: 19px; background: #fff; }
.dlg-head .icon svg { width: 42px; height: 42px; }
.dlg-kicker { margin: 0 0 2px; font-family: var(--hand); font-weight: 700; font-size: 1.35rem; line-height: 1; color: var(--gold); }
dialog h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.42rem; line-height: 1.12; color: #FFF8EA; text-wrap: balance; }
.dlg-body { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
dialog label { margin-top: 10px; font-weight: 800; }
dialog input { width: 100%; min-height: 52px; padding: 10px 14px; border: 1.5px solid #CFC2A8; border-radius: 14px; font: inherit; color: var(--ink); background: #fff; }
dialog input::placeholder { color: #8D897D; }
dialog input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(27, 97, 68, 0.16); }
.hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.error { margin: 8px 0 0; padding: 9px 12px; border-radius: 12px; background: #FCEAE7; font-weight: 800; color: var(--red-d); }
.taken { margin-top: 4px; background: #FFF3DC; border: 1px solid #F1DDB0; border-radius: 14px; padding: 11px 13px; font-size: 0.92rem; }
.taken p { margin: 0 0 6px; font-weight: 800; }
.taken ul { margin: 0; padding-left: 18px; }
.actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ----- merci ! ----- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; max-width: calc(100% - 32px); padding: 13px 22px; border-radius: 99px; background: var(--green-d); color: #fff; font-weight: 800; text-align: center; box-shadow: 0 18px 40px -14px rgba(7, 20, 42, 0.7); transform: translate(-50%, 140%); opacity: 0; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .how { grid-template-columns: 1fr; gap: 10px; }
  .progress { order: -1; flex-basis: 100%; }
  .chips { flex-basis: 100%; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .letter { padding: 6px; border-radius: 18px; }
  .letter-in { padding: 16px 16px 10px; font-size: 1.45rem; border-radius: 13px; }
  .letter .sign { font-size: 1.8rem; }
  .stamp { width: 58px; margin-left: 10px; }
  .card { padding: 22px 16px 16px; border-radius: 22px; }
  .icon { width: 62px; height: 62px; border-radius: 20px; }
  .icon svg { width: 42px; height: 42px; }
  .actions .btn { flex: 1 1 100%; }
  .section-head::after { display: none; }
  .count { margin-left: auto; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:not(.is-locked):hover { transform: translateY(-5px); box-shadow: 0 28px 44px -26px rgba(60, 40, 10, 0.6), 0 4px 10px -4px rgba(60, 40, 10, 0.14); }
  .card:hover .icon { transform: rotate(3deg) scale(1.06); }
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.25s, border-color 0.2s; }
  .icon { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.4); }
  .btn, .chip { transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.1s; }
  .track span { transition: width 0.8s cubic-bezier(0.2, 0.8, 0.3, 1); }
  .toast { transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.3s; }
  .bulb { animation: twinkle 2.6s ease-in-out infinite; }
  .tree .star { transform-box: fill-box; transform-origin: center; animation: star 3s ease-in-out infinite; }
  .tree .ball { animation: twinkle 3.4s ease-in-out infinite; }
  .tree .ball:nth-of-type(2n) { animation-delay: -1.2s; }
  .tree .ball:nth-of-type(3n) { animation-delay: -2.3s; }
  .hero-text > *, .tree-wrap { animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: 0.08s; }
  .hero-text > :nth-child(3) { animation-delay: 0.18s; }
  .tree-wrap { animation-delay: 0.12s; }
  .letter { animation: letter 1s 0.25s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
  .first .card { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
  dialog[open] { animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
  dialog[open]::backdrop { animation: fade 0.25s; }
}
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes star { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(8deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes letter { from { opacity: 0; transform: translateY(40px) rotate(2deg); } to { opacity: 1; transform: rotate(-0.8deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
