/* Le Sapin — feuille de style */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --cream: #0a2a20;
  --cream-2: #0f352a;
  --card: #123c2e;
  --card-2: #0c2b21;
  --ink: #f7f0e0;
  --ink-soft: #d6d3c2;
  --ink-faint: #a6b5a9;
  --green: #8fd3b0;
  --green-2: #2a8062;
  --green-solid: #1f6b4f;
  --red: #e57a68;
  --gold: #e3b768;
  --line: rgba(240, 236, 220, .14);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .3);
  --shadow: 0 22px 56px rgba(0, 0, 0, .42);
  --radius: 20px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--cream);
  background-image:
    radial-gradient(70% 42% at 84% -8%, rgba(227, 183, 104, .18), transparent 70%),
    radial-gradient(58% 46% at 5% 4%, rgba(42, 128, 98, .34), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(196, 129, 45, .16), transparent 70%),
    linear-gradient(180deg, #0d372a 0%, #0a2a20 44%, #071f17 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.has-modal { overflow: hidden; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .6rem;
}
.tiny { font-size: .82rem; color: var(--ink-faint); line-height: 1.5; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 32, 24, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.22rem;
  letter-spacing: .01em;
}
.logo svg { width: 22px; height: 22px; }
.site-nav { display: flex; gap: 22px; margin-left: 8px; }
.site-nav a {
  text-decoration: none;
  font-size: .9rem;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--green); border-color: var(--green); }
.site-header .header-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-link { font-size: .9rem; color: var(--ink-soft); text-decoration: none; }
.header-link:hover { color: var(--green); }

/* ---------------- Boutons ---------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(180deg, #2a7d5d, #1b5f47);
  color: #fdf8ed;
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: linear-gradient(180deg, #34916e, #226f53); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------------- Layout ---------------- */
main { min-height: 70vh; }
section { padding-left: 24px; padding-right: 24px; }
.hero, .steps, .ornament-section, .privacy, .ideas, .faq, .cta-final, .tree-page, .owner, .create, .missing, .loading {
  max-width: 1160px;
  margin: 0 auto;
}

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 54px;
  align-items: center;
  padding-top: 62px;
  padding-bottom: 34px;
}
.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.02; margin-bottom: 18px; }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 44ch; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip-static {
  font-size: .78rem;
  color: #a9e2c4;
  background: rgba(143, 211, 176, .1);
  border: 1px solid rgba(143, 211, 176, .26);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------------- Carte sapin ---------------- */
.tree-card {
  position: relative;
  border-radius: 28px;
  background:
    radial-gradient(80% 60% at 50% 88%, rgba(255, 196, 106, .22), transparent 65%),
    radial-gradient(75% 55% at 50% 0%, rgba(143, 211, 176, .1), transparent 70%),
    linear-gradient(165deg, #164b3a 0%, #0e3126 55%, #081f19 100%);
  padding: 18px 18px 4px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .07);
  overflow: hidden;
}
.tree-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .08);
  pointer-events: none;
}
.tree-card-inner { display: block; }
.tree-svg { display: block; width: 100%; height: auto; }
.tree-card .tree-svg { max-height: min(64vh, 560px); }
.tree-card.is-stage .tree-svg { max-height: min(58vh, 520px); }

.floating-note {
  position: absolute;
  right: 22px;
  bottom: 26px;
  width: 210px;
  background: #faf3e3;
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  transform: rotate(-3deg);
  font-family: var(--serif);
}
.floating-note .floating-from {
  display: block;
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #a97a22;
  margin-bottom: 6px;
}
.floating-note p { font-size: .92rem; line-height: 1.45; color: #1f2c25; }

/* ---------------- Étapes ---------------- */
.steps { padding-top: 70px; padding-bottom: 10px; }
.steps h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 26px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(143, 211, 176, .12);
  color: #a9e2c4;
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: 14px;
}
.step-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step-card p { color: var(--ink-soft); font-size: .94rem; }

/* ---------------- Décorations ---------------- */
.ornament-section { padding-top: 74px; padding-bottom: 20px; }
.section-head { max-width: 620px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 10px; }
.section-head p { color: var(--ink-soft); }
.ornament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.ornament-item {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 8px 12px;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ornament-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.ornament-thumb { width: 58px; height: 62px; display: block; margin: 0 auto 6px; overflow: visible; }
.ornament-item figcaption { font-size: .74rem; color: var(--ink-soft); line-height: 1.3; }

/* ---------------- Confidentialité ---------------- */
.privacy {
  margin-top: 74px;
  background:
    radial-gradient(90% 70% at 12% 0%, rgba(143, 211, 176, .12), transparent 70%),
    linear-gradient(150deg, #154638 0%, #0b2c22 100%);
  border: 1px solid rgba(227, 183, 104, .16);
  color: #f2ead9;
  border-radius: 26px;
  padding: 44px 40px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 44px;
}
.privacy h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); color: #f8f1e2; margin-bottom: 12px; }
.privacy-copy p { color: rgba(242, 234, 217, .76); max-width: 34ch; }
.privacy-grid { display: grid; gap: 20px; }
.privacy-item h3 { font-size: 1.05rem; color: #f8f1e2; margin-bottom: 4px; }
.privacy-item p { font-size: .9rem; color: rgba(242, 234, 217, .7); }

/* ---------------- Idées ---------------- */
.ideas { padding-top: 74px; }
.ideas h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 24px; }
.ideas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.idea-card {
  background: var(--cream-2);
  border-radius: var(--radius);
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, .06);
}
.idea-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.idea-card p { font-size: .9rem; color: var(--ink-soft); }

/* ---------------- FAQ ---------------- */
.faq { padding-top: 74px; max-width: 820px; }
.faq h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 20px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 2px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--ink-soft); font-size: .95rem; }

/* ---------------- CTA final ---------------- */
.cta-final {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 80px;
}
.cta-final h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: 10px; }
.cta-final p { color: var(--ink-soft); margin-bottom: 24px; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(6, 24, 18, .55);
}
.site-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--green); }

/* ---------------- Page création ---------------- */
.create {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  padding-top: 44px;
  padding-bottom: 70px;
  align-items: start;
}
.create-preview { position: sticky; top: 92px; }
.create-form h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 14px; }
.create-form { display: flex; flex-direction: column; gap: 20px; }

/* assistant de création */
.step-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.step-dots li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.step-dots li::after {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--line);
  margin-left: 4px;
}
.step-dots li:last-child::after { display: none; }
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: .72rem;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.step-dots li.is-on { color: var(--ink); }
.step-dots li.is-on .step-num { background: linear-gradient(180deg, #2a7d5d, #1b5f47); border-color: transparent; color: #fdf8ed; }
.step-dots li.is-done .step-num { border-color: rgba(143, 211, 176, .6); color: var(--green); }
.step-dots li.is-done::after { background: rgba(143, 211, 176, .4); }

.step-panel { display: grid; gap: 14px; }
.step-panel[hidden] { display: none; }
.step-title { font-family: var(--serif); font-size: 1.24rem; }
.step-recap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: .82rem;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.step-recap span:first-child { color: var(--ink-soft); }
.step-nav { display: flex; gap: 10px; }
.step-nav #step-next { flex: 1; }

/* bouton + visionneuse 3D */
.preview-3d {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(240, 236, 220, .22);
  background: rgba(8, 32, 24, .74);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: .76rem;
  letter-spacing: .04em;
}
.preview-3d-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
}
.preview-3d:hover { border-color: rgba(143, 211, 176, .6); color: var(--green); }
.preview-3d:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.viewer3d {
  position: relative;
  height: min(58vh, 470px);
  margin: 6px 0 10px;
  border-radius: 18px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(70% 55% at 50% 100%, rgba(227, 183, 104, .16), transparent 70%),
    radial-gradient(60% 50% at 50% 0%, rgba(143, 211, 176, .1), transparent 70%),
    linear-gradient(170deg, #103c2d 0%, #0a2a20 60%, #071f17 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.viewer3d canvas { display: block; width: 100%; height: 100%; }
.viewer3d.is-dragging { cursor: grabbing; }
.viewer3d:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.viewer3d-hint { margin-top: 2px; }

/* choix de l’allure */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  appearance: none;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
}
.mode-card:hover { border-color: rgba(143, 211, 176, .45); }
.mode-card.is-on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(143, 211, 176, .2); }
.mode-card strong { font-family: var(--serif); font-weight: 400; font-size: 1rem; color: var(--ink); }
.mode-card em { font-style: normal; font-size: .74rem; color: var(--ink-faint); line-height: 1.4; }
.mode-visual {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(70% 60% at 50% 25%, rgba(255, 255, 255, .07), rgba(0, 0, 0, .25) 75%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.mode-visual .tree-svg, .mode-visual canvas { display: block; width: 100%; height: 100%; }

/* sapin 3D dans les cartes */
.tree-card.is-3d { height: min(64vh, 560px); padding: 0; }
.tree-card.is-3d .tree-card-inner { position: absolute; inset: 0; }
.tree-card.is-3d canvas { display: block; width: 100%; height: 100%; }
.owner-tree .tree-card.is-3d { height: min(62vh, 540px); }

.field { display: block; }
.field > span, .field > label { display: block; }
.field span {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.field input[type="text"], .field input:not([type]), .field textarea, .field select,
input#share-link {
  width: 100%;
  font-family: var(--sans);
  font-size: .98rem;
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid rgba(240, 236, 220, .18);
  border-radius: 12px;
  padding: 12px 14px;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(143, 211, 176, .16);
}
.field input.is-invalid, .field textarea.is-invalid { border-color: var(--red); }
.counter { display: block; text-align: right; font-size: .72rem; color: var(--ink-faint); font-style: normal; margin-top: 4px; }

.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-card {
  appearance: none;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  display: grid;
  justify-items: center;
  gap: 7px;
  font-size: .72rem;
  color: var(--ink-soft);
  transition: border-color .16s, box-shadow .16s;
}
.style-card i {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.style-card:hover { border-color: rgba(143, 211, 176, .45); }
.style-card.is-on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(143, 211, 176, .2); color: var(--green); }

.topper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.topper-card {
  appearance: none;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--ink-soft);
}
.topper-card.is-on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(143, 211, 176, .2); color: var(--green); }
.topper-thumb {
  width: 96px;
  height: 96px;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(65% 60% at 50% 35%, rgba(255, 255, 255, .08), rgba(0, 0, 0, .22) 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.topper-thumb .tree-svg { width: 100%; height: 100%; }

/* ---------------- Page sapin ---------------- */
.tree-page { padding-top: 40px; padding-bottom: 70px; max-width: 700px; text-align: center; }
.tree-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin: 4px 0 8px; }
.tree-meta { color: var(--ink-soft); font-size: .95rem; }
.tree-meta strong { color: var(--green); }
.tree-page .tree-card { margin-top: 24px; }
.tree-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.tree-foot { margin-top: 16px; font-size: .82rem; color: var(--ink-faint); }

/* ---------------- Espace propriétaire ---------------- */
.owner { padding-top: 40px; padding-bottom: 70px; }
.owner-head { margin-bottom: 24px; }
.owner-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 6px; }
.owner-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 32px; align-items: start; }
.owner-tree { position: sticky; top: 92px; }
.owner-tree .tree-svg { max-height: min(62vh, 540px); }
.owner-panel { display: grid; gap: 18px; }
.panel-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.panel-block h2 { font-size: 1.22rem; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.panel-copy { color: var(--ink-soft); font-size: .92rem; margin-bottom: 14px; }
.tag {
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201, 153, 47, .4);
  border-radius: 999px;
  padding: 2px 8px;
}
.share-row { display: flex; gap: 8px; }
.share-row input { font-size: .84rem; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.share-actions .btn { padding: 9px 16px; font-size: .84rem; }
.sealed-card {
  border: 1px dashed rgba(201, 153, 47, .55);
  background: rgba(201, 153, 47, .07);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}
.sealed-card p { color: var(--ink-soft); font-size: .93rem; }
.sealed-lock {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(227, 183, 104, .18);
  color: var(--gold);
}
.sealed-card .btn { margin-top: 14px; }
.note-list { display: grid; gap: 10px; margin-top: 12px; }
.note-card {
  display: flex;
  gap: 12px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.note-orn { flex: 0 0 40px; }
.note-orn .ornament-thumb { width: 40px; height: 44px; margin: 0; }
.note-body p { font-family: var(--serif); font-size: .98rem; line-height: 1.5; }
.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: .72rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.redecor { display: grid; gap: 12px; }
#notes-block .btn { margin-top: 12px; }

/* ---------------- Modale ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal-root[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(3, 14, 10, .72); backdrop-filter: blur(4px); }
.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(88vh, 860px);
  overflow-y: auto;
  background: #10362a;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  padding: 30px 26px 26px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  animation: pop .24s ease-out;
}
.modal-card.is-wide { width: min(700px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-card h2 { font-size: 1.5rem; margin-bottom: 16px; }
.modal-x {
  position: absolute;
  top: 12px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-soft);
}
.modal-x:hover { color: var(--ink); }
.hang-form { display: grid; gap: 16px; }
.ornament-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  max-height: 208px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ornament-choice {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ornament-choice .ornament-thumb { width: 40px; height: 44px; margin: 0; }
.ornament-choice:hover { background: rgba(143, 211, 176, .08); }
.ornament-choice.is-on { border-color: var(--green); background: rgba(143, 211, 176, .12); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sw);
  border: 1px solid rgba(255, 255, 255, .3);
  cursor: pointer;
  box-shadow: 0 0 0 2px transparent;
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--green); }
.switch { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--green); }

/* ---------------- Divers ---------------- */
.loading, .missing { padding: 90px 24px; text-align: center; }
.my-list { display: grid; gap: 10px; max-width: 420px; margin: 24px auto 0; text-align: left; }
.my-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color .16s, transform .16s;
}
.my-item:hover { border-color: var(--green); transform: translateY(-1px); }
.my-name { font-family: var(--serif); font-size: 1.02rem; }
.my-code { font-size: .74rem; letter-spacing: .16em; color: var(--ink-faint); }
.loading p { color: var(--ink-faint); }
.missing h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 10px; }
.missing p { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 24px; }
.missing .hero-actions { justify-content: center; }

.toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast {
  background: #f7efdd;
  color: #142b22;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .88rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .42);
  animation: toast-in .25s ease-out;
}
.toast.is-out { opacity: 0; transition: opacity .5s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* animations du sapin */
.light { animation: twinkle 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes twinkle { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.spin { animation: spin 46s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.flame { animation: flicker 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flicker { 0%, 100% { transform: scaleY(1); } 40% { transform: scaleY(1.08) scaleX(.94); } 70% { transform: scaleY(.96) scaleX(1.04); } }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 40px; }
  .hero-visual { order: -1; }
  .tree-card .tree-svg { max-height: min(52vh, 460px); }
  .steps-grid { grid-template-columns: 1fr; }
  .privacy { grid-template-columns: 1fr; gap: 26px; padding: 34px 26px; }
  .ideas-grid { grid-template-columns: 1fr 1fr; }
  .create { display: block; padding-top: 24px; }
  .create-form { gap: 16px; }
  .create-form h1 { font-size: 1.7rem; }
  .create-preview {
    position: sticky;
    top: 74px;
    z-index: 8;
    margin: 0 auto 18px;
    padding: 8px 10px 10px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(10, 42, 32, .97) 0%, rgba(10, 42, 32, .97) 82%, rgba(10, 42, 32, 0) 100%);
    backdrop-filter: blur(8px);
  }
  .create-preview .tree-card { max-width: 210px; margin: 0 auto; padding: 8px 8px 2px; border-radius: 18px; }
  .create-preview .tree-card .tree-svg { max-height: 118px; }
  .create-preview #create-hint { display: none; }
  .owner-grid { grid-template-columns: 1fr; }
  .owner-tree { position: static; }
  .site-nav { display: none; }
}

@media (max-width: 620px) {
  .site-header-inner { padding: 12px 16px; gap: 12px; }
  .header-link { display: none; }
  section { padding-left: 16px; padding-right: 16px; }
  .hero-actions .btn { flex: 1; }
  .ideas-grid { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: repeat(4, 1fr); }
  .topper-grid { grid-template-columns: repeat(3, 1fr); }
  .topper-thumb { width: 72px; height: 72px; }
  .viewer3d { height: min(52vh, 380px); }
  .preview-3d { top: 8px; right: 8px; padding: 6px 11px; }
  .tree-card.is-3d { height: min(56vh, 460px); }
  .create-preview .tree-card.is-3d { height: 160px; max-width: 210px; padding: 0; }
  .mode-visual { aspect-ratio: 1 / 1; }
  .step-dots { gap: 10px; }
  .step-dots li { font-size: .64rem; letter-spacing: .04em; gap: 5px; }
  .step-dots li::after { display: none; }
  .step-num { width: 21px; height: 21px; font-size: .66rem; }
  .floating-note { width: 168px; right: 14px; bottom: 18px; padding: 12px; }
  .floating-note p { font-size: .82rem; }
  .tree-actions .btn { flex: 1; }
  .share-row { flex-direction: column; }
  .owner-head h1 { font-size: 1.7rem; }
  .modal-card { padding: 24px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .light, .spin, .flame, .toast, .modal-card { animation: none !important; }
  .btn, .ornament-item { transition: none; }
}

/* ================= Ambiances ================= */
body[data-theme="nuit"] {
  --cream: #071528; --cream-2: #0a1f36; --card: #0e2740; --card-2: #091d31;
  --green: #9cc4f0; --green-2: #2b5f96; --green-solid: #1d4a78; --gold: #f0cf8a;
  background-color: #071528;
  background-image:
    radial-gradient(70% 42% at 84% -8%, rgba(240, 207, 138, .2), transparent 70%),
    radial-gradient(58% 46% at 5% 4%, rgba(43, 95, 150, .4), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(120, 150, 210, .18), transparent 70%),
    linear-gradient(180deg, #0b2440 0%, #071528 46%, #04101f 100%);
}
body[data-theme="dore"] {
  --cream: #241a0d; --cream-2: #2c2111; --card: #332717; --card-2: #241a0d;
  --green: #f2d08a; --green-2: #96702a; --green-solid: #7b5a1f; --gold: #f6dfa8;
  background-color: #241a0d;
  background-image:
    radial-gradient(70% 42% at 84% -8%, rgba(246, 223, 168, .24), transparent 70%),
    radial-gradient(58% 46% at 5% 4%, rgba(150, 112, 42, .34), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(196, 129, 45, .22), transparent 70%),
    linear-gradient(180deg, #33240f 0%, #241a0d 46%, #170f07 100%);
}
body[data-theme="givre"] {
  --cream: #0e1a1f; --cream-2: #122229; --card: #172a32; --card-2: #0e1a1f;
  --green: #b8dbe6; --green-2: #4d7c8c; --green-solid: #356070; --gold: #d8e9ef;
  background-color: #0e1a1f;
  background-image:
    radial-gradient(70% 42% at 84% -8%, rgba(184, 219, 230, .18), transparent 70%),
    radial-gradient(58% 46% at 5% 4%, rgba(77, 124, 140, .32), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(120, 160, 175, .16), transparent 70%),
    linear-gradient(180deg, #13242b 0%, #0e1a1f 46%, #081013 100%);
}
body[data-theme="bonbon"] {
  --cream: #22101a; --cream-2: #2b1522; --card: #341a29; --card-2: #22101a;
  --green: #f0b9c9; --green-2: #9a4a68; --green-solid: #7d3a54; --gold: #f3d2a2;
  background-color: #22101a;
  background-image:
    radial-gradient(70% 42% at 84% -8%, rgba(243, 210, 162, .2), transparent 70%),
    radial-gradient(58% 46% at 5% 4%, rgba(154, 74, 104, .36), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(196, 129, 45, .14), transparent 70%),
    linear-gradient(180deg, #331824 0%, #22101a 46%, #150910 100%);
}

/* ================= Bandeau défi ================= */
.challenge-band {
  display: flex; align-items: center; gap: 30px; justify-content: space-between;
  max-width: 1160px; margin: 10px auto 0; padding: 30px 34px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(143, 211, 176, .1), rgba(227, 183, 104, .08));
}
.challenge-band h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: 10px; }
.challenge-band p { color: var(--ink-soft); max-width: 62ch; }
.challenge-band .btn { flex: none; }

/* ================= Thèmes de création ================= */
.step-title-sub { margin-top: 22px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-card {
  display: grid; justify-items: start; gap: 3px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card-2);
  cursor: pointer; text-align: left; transition: border-color .18s, transform .18s;
}
.theme-card:hover { transform: translateY(-1px); }
.theme-card strong { font-size: .86rem; }
.theme-card em { font-style: normal; font-size: .72rem; color: var(--ink-faint); }
.theme-card.is-on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.theme-dot { width: 100%; height: 6px; border-radius: 99px; display: block; margin-bottom: 4px; }
.theme-dot[data-theme-dot="sapin"] { background: linear-gradient(90deg, #14513c, #8fd3b0, #e3b768); }
.theme-dot[data-theme-dot="nuit"] { background: linear-gradient(90deg, #0b2440, #9cc4f0, #f0cf8a); }
.theme-dot[data-theme-dot="dore"] { background: linear-gradient(90deg, #33240f, #96702a, #f6dfa8); }
.theme-dot[data-theme-dot="givre"] { background: linear-gradient(90deg, #13242b, #4d7c8c, #d8e9ef); }
.theme-dot[data-theme-dot="bonbon"] { background: linear-gradient(90deg, #331824, #9a4a68, #f0b9c9); }
.ref-note { margin: -6px 0 4px; color: var(--green); }

/* ================= Jauge, badges, réservations ================= */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.badge {
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line);
  color: var(--ink-soft); background: rgba(255, 255, 255, .04);
}
.badge-partage { border-color: rgba(227, 183, 104, .55); color: var(--gold); }
.badge-plein { border-color: rgba(143, 211, 176, .55); color: var(--green); }
.badge-viral { border-color: rgba(229, 122, 104, .55); color: var(--red); }

.gauge { max-width: 520px; margin: 16px auto 0; }
.gauge-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.gauge-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-2), var(--gold)); transition: width .5s ease; }
.gauge-label { margin-top: 7px; font-size: .8rem; color: var(--ink-faint); text-align: center; }
.gauge-label strong { color: var(--ink); }

.slot-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 14px; }
.slot-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.slot-chip {
  font-size: .78rem; padding: 4px 10px; border-radius: 99px;
  border: 1px dashed rgba(227, 183, 104, .5); color: var(--gold);
}

/* ================= Villes ================= */
.cities, .advent, .owner-words { max-width: 620px; margin: 38px auto 0; text-align: center; }
.cities h2, .advent h2, .owner-words h2 { font-size: 1.15rem; margin-bottom: 12px; }
.city-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.city-chip {
  font-size: .8rem; padding: 5px 11px; border-radius: 99px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
}
.city-chip em { font-style: normal; color: var(--gold); margin-left: 4px; }
.owner-word {
  font-family: var(--serif); font-size: 1.02rem; color: var(--ink);
  border-left: 2px solid var(--gold); padding: 2px 0 2px 14px; margin: 10px 0; text-align: left;
}

/* ================= Calendrier ================= */
.advent-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.advent-dot {
  aspect-ratio: 1 / 1; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); color: var(--ink-faint); font-size: .7rem; cursor: default;
}
.advent-dot.is-open {
  cursor: pointer; color: var(--cream); background: linear-gradient(160deg, rgba(227, 183, 104, .85), rgba(143, 211, 176, .7));
  color: #0a2a20; font-weight: 600; border-color: transparent;
}

/* ================= Photo du sapin ================= */
.tree-card.has-photo .tree-card-inner {
  background-image: linear-gradient(180deg, rgba(7, 31, 23, .55), rgba(7, 31, 23, .82)), var(--tree-photo);
  background-size: cover; background-position: center; border-radius: inherit;
}

/* ================= Hang modal ================= */
.kind-switch { display: flex; gap: 6px; margin: 0 0 16px; }
.kind-switch button {
  flex: 1; padding: 9px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: .85rem;
}
.kind-switch button.is-on { border-color: var(--green); background: rgba(143, 211, 176, .12); }
.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.media-block { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.media-label { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: 7px; }
.media-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-small { padding: 6px 11px; font-size: .78rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green); cursor: pointer; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.photo-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 12px; margin-top: 10px; }

/* ================= Notes ================= */
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.mini-tag { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-faint); }
.note-photo { width: 100%; max-width: 220px; border-radius: 10px; margin-top: 6px; }
.note-tags audio { width: 100%; max-width: 240px; height: 34px; margin-top: 6px; }
.note-reply { font-size: .82rem; color: var(--green); border-left: 2px solid var(--green); padding-left: 8px; margin-top: 6px; }

/* ================= Co-hôtes, défi, admin ================= */
.host-list { display: grid; gap: 6px; margin: 10px 0; }
.host-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .86rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.claim-form { display: grid; gap: 8px; margin-top: 12px; }
.challenge-ok { color: var(--green); font-size: .9rem; }
.challenge-pending { color: var(--gold); font-size: .9rem; }
.challenge-no { color: var(--red); font-size: .9rem; }
.admin-page { max-width: 720px; }
.admin-list { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.claim-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card-2); }
.claim-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.claim-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; font-size: .82rem; }
.claim-links a { color: var(--green); }
.claim-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ================= Neige ================= */
.tree-card { position: relative; }
.snow-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.snow-layer i {
  position: absolute; top: -10px; display: block; border-radius: 50%;
  background: #fff; opacity: 0; animation: snowfall linear forwards;
}
@keyframes snowfall {
  0% { opacity: 0; transform: translate3d(0, -10px, 0); }
  10% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(var(--drift, 0), 340px, 0); }
}
@media (prefers-reduced-motion: reduce) { .snow-layer { display: none; } }

/* ================= Décors animés, guirlande ================= */
.deco-lanterne, .deco-bougie { animation: softGlow 4.2s ease-in-out infinite; }
.deco-givre, .deco-flocon { animation: shimmer 6s ease-in-out infinite; }
@keyframes softGlow { 0%, 100% { opacity: .94; } 50% { opacity: 1; filter: brightness(1.12); } }
@keyframes shimmer { 0%, 100% { opacity: .9; } 50% { opacity: 1; } }
.light.blink { animation: bulbBlink 1.9s steps(1, end) infinite; }
@keyframes bulbBlink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: .28; } }
@media (prefers-reduced-motion: reduce) {
  .light.blink, .deco-lanterne, .deco-bougie, .deco-givre, .deco-flocon { animation: none; }
}

@media (max-width: 960px) {
  .challenge-band { flex-direction: column; align-items: flex-start; margin-left: 20px; margin-right: 20px; padding: 24px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .media-row { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .challenge-band { margin-left: 16px; margin-right: 16px; }
  .advent-grid { grid-template-columns: repeat(8, 1fr); }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .kind-switch button { font-size: .8rem; }
}

/* ================= Compte à rebours ================= */
.countdown {
  display: inline-flex; flex-direction: column; gap: 6px;
  margin: 2px 0 16px; padding: 12px 16px 13px;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}
.countdown-label {
  font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
}
.countdown-cells { display: flex; align-items: baseline; gap: 16px; }
.cd-cell { display: flex; align-items: baseline; gap: 5px; }
.cd-cell strong {
  font-family: var(--serif); font-weight: 400; font-size: 1.55rem;
  line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.cd-cell em {
  font-style: normal; font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.tree-page .countdown { margin: 16px auto 0; }
.tree-page .countdown-cells { justify-content: center; }
.badge-premium { border-color: rgba(227, 183, 104, .6); color: var(--gold); }
#pay-block .btn { margin-bottom: 10px; }
@media (max-width: 520px) {
  .countdown-cells { gap: 11px; }
  .cd-cell strong { font-size: 1.3rem; }
  .cd-cell em { display: none; }
}
