*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Couleurs de l'app (Assets.xcassets/Colors) */
:root {
  --bg: #0A0C10;
  --gold: #FFD700;
  --accent: #E55349;
  --card: #16181C;
  --muted: rgba(255,255,255,.55);
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/Nunito-Variable.woff2') format('woff2');
}

html { background: var(--bg); overflow-x: clip; }
/* Safari (iPhone) ignore le clip posé sur la page entière : les éléments qui
   débordent (iPhones en éventail, urne, avatars) permettaient de faire
   glisser la page de côté. Posé sur chaque section, il est respecté — et
   « clip » (pas « hidden ») laisse déborder en hauteur. Téléphone seulement :
   sur grand écran les sections sont plus étroites que la fenêtre et le halo
   de l'ouverture serait coupé. */
@media (max-width: 860px) {
  .hero, .step, .closing, .footer { overflow-x: clip; }
}
body {
  background: var(--bg);
  color: #fff;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
.gold { color: var(--gold); }
b { font-weight: 800; }

/* ── Barre du haut ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: linear-gradient(var(--bg) 40%, transparent);
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.brand-mascot { width: 38px; height: 38px; }
.brand-mascot svg, .hero-mascot svg, .draw-mascot svg, .urn svg { width: 100%; height: 100%; display: block; overflow: visible; }
.brand-name { font-weight: 900; font-size: 20px; letter-spacing: -.3px; }

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.cta:hover { transform: scale(1.04); }
.cta:active { transform: scale(.96); }
.cta svg { width: 20px; height: 20px; }
.cta-small { padding: 10px 18px; font-size: 14px; gap: 7px; box-shadow: none; }
.cta-small svg { width: 16px; height: 16px; }

/* ── Particules (même mécanique que ParticleView dans l'app) ── */
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles span {
  position: absolute; border-radius: 50%;
  animation: twinkle ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: .08; transform: translateY(0); }
  to   { opacity: var(--op); transform: translateY(var(--dy)); }
}

/* ── Ouverture ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 24px;
  padding: 110px max(32px, 5vw) 60px;
  max-width: 1400px; margin: 0 auto;
}
.hero::before {
  content: ""; position: absolute; inset: 0 -50vw; z-index: -1;
  background: radial-gradient(ellipse 60% 55% at 50% 0%, rgba(255,255,255,.09), transparent 70%);
}
.hero-text { position: relative; z-index: 2; }
.hero-mascot { width: clamp(150px, 17vw, 230px); aspect-ratio: 1; margin-left: -6%; }
.hero-title {
  font-weight: 900; letter-spacing: -.045em; line-height: .95;
  font-size: clamp(64px, 9vw, 132px);
  margin-top: 4px;
}
.hero-tagline { font-weight: 900; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.02em; margin-top: 10px; }
.hero-sub { color: var(--muted); font-weight: 600; font-size: clamp(16px, 1.4vw, 19px); margin: 16px 0 30px; }

.fan { position: relative; width: 100%; aspect-ratio: 2200 / 2350; }
.fan-phone {
  position: absolute;
  left: calc(var(--x) * 100%); top: calc(var(--y) * 100%);
  width: calc(var(--w) * 132%);
  transform: translate(-50%, -62.4%) rotate(var(--r));
  transform-origin: 50% 62.4%;
}
.fan-phone .float, .fan-phone .bob { position: relative; transform-origin: 50% 62.4%; will-change: transform; }
.fan-phone .layer, .urn { will-change: transform; }
.fan-phone img { display: block; width: 100%; height: auto; }
.fan-phone .bob > img:first-child { filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)); }
/* Éléments qui débordent : calques posés à leur place exacte (ombre comprise) */
.fan-phone .layer { position: absolute; height: auto; }
/* Urne posée sur l'iPhone du vote, comme sur le screenshot (repère 1320 × 2960) */
.urn {
  position: absolute; left: 1.894%; top: 21.115%; width: 94.697%; aspect-ratio: 1;
  transform: rotate(-6deg);
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.45));
}

/* ── Étapes ── */
.step {
  position: relative;
  padding: 120px 20px 140px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.step::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255,255,255,.07), transparent 70%);
}
.step-head { position: relative; z-index: 1; }
.step-title span { white-space: nowrap; }
.step-title { font-weight: 900; letter-spacing: -.04em; line-height: 1; font-size: clamp(44px, 6.5vw, 84px); }
.step-body { color: var(--muted); font-weight: 600; font-size: clamp(16px, 1.4vw, 19px); max-width: 440px; margin: 18px auto 0; }

/* ── Le tirage ── */
.draw {
  /* Largeur de l'écran d'iPhone : l'étape entière tient dans la fenêtre */
  --p: min(64vw, 320px, calc((100svh - 300px) * .46));
  position: relative;
  width: var(--p); height: calc(var(--p) * 2622 / 1206);
  margin-top: 70px;
  text-align: center;
}
.draw-phone {
  position: absolute; inset: 0;
  border-radius: calc(var(--p) * .135);
  background:
    radial-gradient(ellipse 90% 45% at 50% 0%, rgba(255,255,255,.07), transparent 70%),
    #0D0F13;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14), 0 40px 80px rgba(0,0,0,.55);
  overflow: hidden;
}
.draw-hello { position: absolute; top: 68%; left: 0; right: 0; opacity: 0; }
.draw-hello small { display: block; font-weight: 600; font-size: calc(var(--p) * .05); color: rgba(255,255,255,.45); }
.draw-hello b { display: block; font-weight: 800; font-size: calc(var(--p) * .095); text-shadow: 0 0 18px rgba(255,215,0,.35); }
.draw-mascot {
  position: absolute; left: 50%; top: 55%;
  width: calc(var(--p) * .5); aspect-ratio: 1;
  translate: -50% -50%;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.5));
}
.draw-avatars, .draw-burst { position: absolute; inset: 0; pointer-events: none; }
.av {
  position: absolute; left: 50%; top: 55%;
  width: calc(var(--p) * .27); aspect-ratio: 1;
  margin: calc(var(--p) * -.135) 0 0 calc(var(--p) * -.135);
  border-radius: 50%;
  border: calc(var(--p) * .012) solid rgba(255,255,255,.22);
  box-shadow: 0 0 0 calc(var(--p) * .012) var(--bg), 0 14px 26px rgba(0,0,0,.5);
  overflow: hidden; background: #222;
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av { transition: border-color .35s; }
.av.winner { border-color: var(--gold); }
.spark { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; }

/* Grand écran : texte à gauche, iPhone à droite, l'étape tient dans la fenêtre */
@media (min-width: 861px) {
  .step {
    min-height: 100svh;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center; gap: 40px;
    max-width: 1180px; margin: 0 auto;
    text-align: left;
    padding: 100px max(32px, 5vw);
  }
  .step-body { margin-left: 0; }
  .draw, .phone { --p: min(320px, calc((100svh - 160px) * .46)); margin: 0 auto; }
  .step.flip .step-head { order: 2; }
}


.accent { color: var(--accent); }

/* ── iPhone des étapes : écran aux coins arrondis, éléments qui débordent ──
   Coordonnées des éléments en % de l'écran (largeur pour x, hauteur pour y),
   tailles en cqw (1 cqw = 1 % de la largeur de l'écran). */
.phone {
  --p: min(64vw, 320px, calc((100svh - 300px) * .46));
  position: relative;
  width: var(--p); height: calc(var(--p) * 2622 / 1206);
  container-type: inline-size;
  margin-top: 70px;
  font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  text-align: center;
}
.scr {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 13.5cqw;
  background: var(--bg);
  box-shadow: 0 40px 80px rgba(0,0,0,.55);
}
.scr::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14);
}
.scr-base { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-screen {
  background:
    radial-gradient(circle var(--glow-r) at 50% 0, rgba(255,255,255,var(--glow)), transparent),
    var(--bg);
}
.at {
  position: absolute;
  left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  width: calc(var(--w, auto) * 1%);
  /* --fx/--fy/--fr : flottement (animé par GSAP), en plus de la pose */
  transform: translate(-50%, -50%) translate(var(--fx, 0px), var(--fy, 0px)) rotate(calc(var(--r, 0deg) + var(--fr, 0deg)));
}
.at:not([style*="--w"]) { width: max-content; }
.mv { display: block; width: 100%; will-change: transform; }
img.mv { height: auto; }
.burst, .bubbles { position: absolute; inset: 0; pointer-events: none; }

.close {
  position: absolute; left: 90.4%; top: 10%; width: 10.8cqw; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(255,255,255,.08); display: grid; place-items: center;
}
.close svg { width: 45%; }

/* Fil */
.feed-timer {
  font-weight: 900; font-size: 18.6cqw; letter-spacing: -.02em; line-height: 1;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 1.8cqw 3cqw rgba(0,0,0,.45);
}
.pill {
  display: inline-flex; align-items: center; gap: calc(var(--s) * .3cqw);
  padding: calc(var(--s) * .3cqw) calc(var(--s) * .55cqw);
  border-radius: 999px; background: #1E2026;
  font-weight: 800; font-size: calc(var(--s) * 1cqw); color: #fff; white-space: nowrap;
  box-shadow: 0 1.8cqw 3cqw rgba(0,0,0,.45);
}
.pill svg { width: 1.15em; height: 1.15em; }
/* Bulles éphémères, comme ChatBubble dans l'app (402 pt = 100 cqw) */
.ebubble {
  position: absolute; left: 50%; bottom: 11.1%;
  display: flex; align-items: flex-start; gap: 2cqw;
  max-width: 64.7cqw; width: max-content;
  padding: 2cqw 3cqw; border-radius: 4.5cqw;
  background: rgba(0,0,0,.5);
  text-align: left; will-change: transform, opacity;
}
.ebubble img { width: 7cqw; height: 7cqw; border-radius: 50%; object-fit: cover; flex: none; }
.ebubble.elu img { box-shadow: 0 0 0 .5cqw var(--gold); }
.ebubble b { display: block; font-weight: 700; font-size: 2.74cqw; color: rgba(255,255,255,.5); }
.ebubble.elu b { color: var(--gold); }
.ebubble span { display: block; font-weight: 500; font-size: 3.23cqw; color: #fff; line-height: 1.3; }

/* Cartes de l'app (vote, candidature) */
.card-zone {
  position: absolute; left: 4.1%; right: 4.1%;
  top: calc(var(--top) * 1%); bottom: calc((100 - var(--bottom)) * 1%);
}
.app-card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw;
  padding: 6cqw; border-radius: 6cqw; background: #16181C; color: #fff;
}
.card-title { font-weight: 900; font-size: 6cqw; line-height: 1.15; }
.divider { display: block; width: 100%; height: 1px; background: rgba(255,255,255,.1); }
.card-text { font-weight: 500; font-size: 3.73cqw; line-height: 1.45; color: rgba(255,255,255,.7); }
.card-text b { font-weight: 700; color: rgba(255,255,255,.85); }
.red-pill {
  display: inline-flex; align-items: center; gap: 1.5cqw;
  padding: 1.7cqw 3.5cqw; border-radius: 999px; background: #E5383B;
  font-weight: 800; font-size: 3cqw; white-space: nowrap;
}
.red-pill svg { width: 3cqw; }
.results-card { inset: -2cqw 0 -4cqw; opacity: 0; gap: 2cqw; align-items: stretch; text-align: left; box-shadow: 0 3cqw 5cqw rgba(0,0,0,.5); }
.results-card .caps, .results-card .card-title, .results-card .soft-pill { align-self: center; }
.caps { font-weight: 800; font-size: 2.9cqw; letter-spacing: .25em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.soft-pill {
  display: inline-flex; align-items: center; gap: 1.5cqw;
  padding: 1.4cqw 3.5cqw; border-radius: 999px; background: rgba(255,255,255,.07);
  font-weight: 700; font-size: 3.3cqw; color: rgba(255,255,255,.55);
}
.soft-pill svg { width: 4.4cqw; }
.row { flex: none; display: flex; justify-content: space-between; align-items: flex-end; margin-top: 2cqw; }
.row-name { font-weight: 800; font-size: 4.4cqw; display: flex; align-items: center; gap: 2cqw; }
.mine { font-style: normal; font-weight: 800; font-size: 2.7cqw; padding: .8cqw 2.4cqw; border-radius: 999px; background: #34C759; color: #fff; }
.row-pct { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.row-pct b { font-weight: 900; font-size: 5.5cqw; }
.row-pct small { font-weight: 600; font-size: 3.2cqw; color: rgba(255,255,255,.5); }
.red { color: #FF4D4F; } .green { color: #34C759; }
.bar { flex: none; height: 2.8cqw; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 2.8cqw; width: 0; border-radius: inherit; }
.bar i.red { background: #FF4D4F; } .bar i.green { background: #34C759; }

/* Vote */
.big-btn {
  width: 54cqw; height: 17cqw; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 6.6cqw; color: #fff;
  box-shadow: 0 1.8cqw 3cqw rgba(0,0,0,.45);
}
.big-btn.red { background: #E55349; color: #fff; }
.big-btn.green { background: #34C759; color: #fff; }
.urn-big, .vote-mascot, .cand-mascot { aspect-ratio: 1; }
.urn-big svg, .vote-mascot svg, .cand-mascot svg, .mini-mascot svg, .closing-mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.urn-big { filter: drop-shadow(0 2.6cqw 3cqw rgba(0,0,0,.45)); }
.vote-mascot, .cand-mascot { filter: drop-shadow(0 2.4cqw 3cqw rgba(0,0,0,.45)); }
.vote-mascot { opacity: 0; }
.vote-foot { position: absolute; left: 0; right: 0; top: 89.5%; display: flex; flex-direction: column; gap: 1.2cqw; }
.vote-timer { font-weight: 700; font-size: 3.7cqw; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.vote-note { font-weight: 600; font-size: 2.7cqw; color: rgba(255,255,255,.3); }

/* Candidature (CandidacyInfoCard de l'app) */
.cand-btn > span { grid-area: 1 / 1; transition: opacity .35s, filter .35s; }
.cand-btn { display: grid; }
.on { opacity: 0; filter: blur(4px); }
.postulated .on { opacity: 1; filter: none; }
.postulated .off { opacity: 0; filter: blur(4px); }
.status {
  padding: 1.74cqw 3.5cqw; border-radius: 999px; background: rgba(255,255,255,.07);
  font-weight: 600; font-size: 3cqw; letter-spacing: .04em; color: rgba(255,255,255,.5);
  white-space: nowrap; will-change: transform;
}
/* Hauteurs fixes : le titre passe de 2 lignes (« Devenir le prochain The
   One ? ») à 1 (« Ce sera peut-être toi ! ») — sans ça, toute la carte se
   recentrait d'un coup au milieu du fondu */
.cand-card { gap: 3.2cqw; padding: 5cqw 6cqw; }
#candTitle { min-height: 2.3em; display: flex; align-items: center; justify-content: center; }
#candText { min-height: 7.3em; display: flex; align-items: center; justify-content: center; }
.cand-btn {
  height: 21.4cqw; border-radius: 999px; place-items: center;
  font-weight: 800; font-size: 6cqw; color: #fff;
  background: #2DB84F; transition: background .35s;
  box-shadow: 0 2cqw 3.4cqw rgba(0,0,0,.45);
}
.postulated .cand-btn { background: #DA3A3D; }
.cand-btn span { display: flex; align-items: center; gap: 2.2cqw; }
.cand-btn svg { width: 6.4cqw; }
.cand-foot { position: absolute; left: 0; right: 0; top: 96%; font-weight: 600; font-size: 2.7cqw; color: rgba(255,255,255,.3); }
.postule-pill {
  display: inline-flex; align-items: center; gap: 2.2cqw;
  padding: 2.6cqw 5cqw 2.6cqw 3.4cqw; border-radius: 999px; background: #2A2D33;
  font-weight: 800; font-size: 7cqw; color: #fff; white-space: nowrap;
  box-shadow: 0 1.8cqw 3cqw rgba(0,0,0,.45); opacity: 0;
}
.mini-mascot { width: 9.6cqw; height: 9.6cqw; display: block; }

/* Pastilles : texte centré pareil quelle que soit la police (SF Rounded sur
   Apple, Nunito ailleurs, aux hauteurs de ligne différentes) ; text-indent
   compense l'espacement des lettres ajouté après la dernière */
.status, .red-pill, .soft-pill, .mine, .pill, .postule-pill {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1.15;
}
.status { text-indent: .04em; }
.status-pop {
  padding: 2.4cqw 5cqw; border-radius: 999px; background: #2A2D33;
  font-weight: 800; font-size: 4.5cqw; letter-spacing: .02em; color: #fff; white-space: nowrap;
  display: inline-flex; align-items: center; line-height: 1.15;
  box-shadow: 0 1.8cqw 3cqw rgba(0,0,0,.45); opacity: 0;
}

/* Fin */
.closing { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 20px 120px; gap: 26px; }
/* Au-dessus des particules (positionnées), comme dans l'ouverture */
.closing > :not(.sparkles) { position: relative; z-index: 1; }
.closing-mascot { width: clamp(150px, 20vw, 220px); aspect-ratio: 1; }

/* ── Bas de page ── */
.footer { text-align: center; padding: 40px 20px max(40px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 12px; }
.footer-links a { color: rgba(255,255,255,.7); text-decoration: none; font-weight: 700; }
.footer .dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.3); }
.copy { margin-top: 10px; color: rgba(255,255,255,.3); }

/* ── Téléphone ── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 96px 16px 40px;
    gap: 10px;
  }
  .hero-mascot { margin: 0 auto; width: clamp(130px, 38vw, 180px); }
  .hero-sub { margin: 14px auto 26px; }
  /* Les iPhones dépassent au-dessus de leur boîte (ancrés au centre de
     l'écran) : on leur laisse la place sous le bouton */
  .fan { max-width: 520px; margin: 14% auto -6%; }
  .step { padding: 80px 16px 110px; }
  .draw, .phone { margin-top: 48px; --p: min(60vw, calc((100svh - 330px) * .46)); }
}
@media (prefers-reduced-motion: reduce) {
  .sparkles span { animation: none; opacity: .3; }
}

/* (après .phone) grand écran : même taille que le tirage, centré dans sa colonne */
@media (min-width: 861px) {
  .phone { --p: min(320px, calc((100svh - 160px) * .46)); margin: 0 auto; }
}
