:root {
  --ground: #FBF6F0;
  --surface: #FFFFFF;
  --surface-2: #F3ECE3;
  --ink: #17131A;
  --muted: #6B6272;
  --line: #E8DFD4;
  --accent: #FF4F2E;
  --accent-ink: #FFFFFF;
  --good: #14A36A;
  --btn: #17131A;
  --btn-ink: #FFFFFF;
  --focus: #FF4F2E;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Onest", "Helvetica Neue", system-ui, sans-serif;
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141015;
    --surface: #1D181F;
    --surface-2: #28212B;
    --ink: #F6F0EA;
    --muted: #A99EAE;
    --line: #342B37;
    --accent: #FF6A4D;
    --good: #3CCB8B;
    --btn: #F6F0EA;
    --btn-ink: #141015;
    --focus: #FF8A70;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

.top { padding: 18px 20px 0; max-width: 640px; width: 100%; margin: 0 auto; }
.brand, .brand-small { font: 800 26px/1 var(--display); letter-spacing: -.03em; text-decoration: none; }
.brand span, .brand-small span { color: var(--accent); }
.brand-small { font-size: 17px; margin-right: 6px; }

.shell { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.08; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 9vw, 52px); font-weight: 800; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--muted); }
.kicker { font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.fine { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 14px 22px;
  background: var(--btn); color: var(--btn-ink);
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-big { width: 100%; padding: 18px 24px; font-size: 18px; margin: 8px 0 10px; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }

/* Accueil */
.hero { padding: 24px 0 8px; }
.steps { display: grid; gap: 12px; margin: 28px 0; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.step b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 16px/1 var(--display); margin-bottom: 10px; }
.step h2 { font-size: 19px; margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; }
.promise { background: var(--ink); color: var(--ground); border-radius: var(--radius); padding: 24px 20px; margin: 28px 0; }
.promise p { opacity: .85; }
.checks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checks li::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 10px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Formulaires */
label.field { display: block; margin: 0 0 14px; font-weight: 600; }
label.field span.hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  display: block; width: 100%; margin-top: 6px; padding: 14px 16px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
}
.input:focus { border-color: var(--ink); outline: none; }
textarea.input { min-height: 88px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 6px 0 16px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; inset: 0; }
.choices span { display: inline-block; padding: 10px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 500; cursor: pointer; }
.choices input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--ground); }
.choices input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.error { color: var(--accent); font-weight: 600; min-height: 1.5em; }

/* Grille de photos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0; }
.thumb { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x, .thumb .star {
  position: absolute; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  display: grid; place-items: center; font-size: 15px; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
}
.thumb .x { right: 6px; }
.thumb .star { left: 6px; }
.thumb .star[aria-pressed="false"] { filter: grayscale(1); }
.thumb .star[aria-pressed="true"] { background: var(--accent); }
.thumb .rank { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; font: 800 14px/1 var(--display); padding: 6px 8px; border-radius: 10px; }
.thumb.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .5); animation: pulse 1s infinite alternate; }
.add-tile {
  aspect-ratio: 4 / 5; border-radius: 14px; border: 2px dashed var(--line); background: transparent;
  display: grid; place-items: center; font-size: 30px; color: var(--muted); cursor: pointer;
}
@keyframes pulse { from { opacity: .2; } to { opacity: .8; } }

/* Vote en duels */
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.duel button { position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 5; background: var(--surface-2); transition: transform .15s ease; }
.duel button img { width: 100%; height: 100%; object-fit: cover; }
.duel button:hover { transform: translateY(-2px); }
.duel button.picked { outline: 4px solid var(--accent); transform: scale(.98); }
.duel button.picked::after { content: "💘"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; background: rgba(0, 0, 0, .25); }
.dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }

/* Progression et résultats */
.progress { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 14px; word-break: break-all; margin: 10px 0; }
.winner { display: grid; grid-template-columns: 42% 1fr; gap: 16px; align-items: center; }
.winner .thumb { border-radius: 18px; box-shadow: 0 0 0 4px var(--accent); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--ink); }
.ranklist { display: grid; gap: 10px; margin: 12px 0; }
.rankrow { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.rankrow .thumb { border-radius: 10px; }
.callout { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-weight: 500; }

.offers { display: grid; gap: 12px; }
.offer { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.offer.best { border-color: var(--accent); }
.offer .price { font: 800 32px/1 var(--display); margin: 4px 0 10px; }
.offer ul { padding-left: 18px; margin: 0 0 14px; }
.offer li { margin: 4px 0; }
.tag { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

.deliver .copyable { background: var(--surface-2); border-radius: 14px; padding: 14px; margin: 10px 0; }
.deliver .copyable p { white-space: pre-wrap; margin: 0; }
.deliver .copyable small { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.deliver .copyable button { margin-top: 8px; padding: 8px 14px; font-size: 14px; }
.tips { display: grid; gap: 10px; }
.tip { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }

.legal h1 { font-size: 34px; }
.legal h2 { font-size: 20px; margin-top: 24px; }
.legal li { margin: 6px 0; }

.foot { max-width: 640px; width: 100%; margin: 0 auto; padding: 24px 16px 36px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0)); transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  max-width: calc(100% - 32px); z-index: 10;
}

@media (min-width: 560px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .offers { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
