/* Couleurs et formes de l'app (app/src/theme.ts, app/src/ui.tsx). Jamais de rouge. */
@font-face { font-family: Fredoka; font-weight: 400; font-display: swap; src: url(/fonts/Fredoka-400.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(/fonts/Fredoka-600.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(/fonts/Fredoka-700.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --encre: #263f3e;
  --encre-douce: #4f625d;
  --accent: #316c58;
  --surface: #fffcef;
  --carte: #fffefa;
  --bord: #b7c9ac;
  --choisi: #ece4ff;
  --choisi-bord: #8a6fd0;
  --juste: #c7e9b5;
  --juste-bord: #48824a;
  --juste-encre: #3e7a4c;
  --feuille-juste: #e3f0d7;
  --feuille-juste-bord: #9bbb83;
  --gris: #d6dfd5;
  --gris-encre: #566458;
  --gris-bord: #b6c2b5;
  --bourse: #fff5d6;
  --bourse-bord: #b8822c;
  --bourse-encre: #654816;
  --piece: #f2cc64;
  --piece-bord: #bd8a2d;
  --crin: #9270d9;
  --ardoise: #2c4a3a;
  --cadre: #8a6a4a;
  --rayon: 22px;
}
* { box-sizing: border-box; }
html { overflow-x: clip; font-family: Fredoka, ui-rounded, "SF Pro Rounded", system-ui, sans-serif; color: var(--encre); background: var(--surface); -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; display: block; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Boutons : bord du bas épais, comme dans l'app. */
.bouton, .badge {
  display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 28px;
  border-radius: var(--rayon); border: 1px solid #ffffff70; border-bottom: 5px solid #172f3650;
  background: var(--accent); color: #fff; font: 600 1.375rem/1 Fredoka, sans-serif; text-decoration: none; cursor: pointer;
}
.bouton:active { transform: translateY(3px); border-bottom-width: 2px; }

/* En-tête : plaque du nom à gauche, bourse de pièces à droite. */
.barre { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 4vw, 40px); }
.marque, .plaque {
  display: inline-flex; align-items: center; gap: 10px; background: #fffcefe8; border-radius: var(--rayon);
  border-bottom: 4px solid #24464b14; color: var(--encre); text-decoration: none;
}
.marque { padding: 6px 16px 6px 6px; font-weight: 700; font-size: 1.375rem; }
.marque img { width: 44px; height: 44px; border-radius: 12px; }
.bourse {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border-radius: 28px;
  background: var(--bourse); border: 1px solid #c6933670; border-bottom: 4px solid var(--bourse-bord);
  font-weight: 600; font-size: 1.375rem; color: var(--bourse-encre); min-width: 72px;
}
.bourse.gagne { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.piece {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--piece); border: 2px solid var(--piece-bord); color: var(--bourse-bord); font-weight: 700; font-size: 17px; line-height: 1;
}
.piece-vole { position: fixed; z-index: 20; pointer-events: none; transition: transform .7s cubic-bezier(.5, -0.4, .6, 1), opacity .7s; }

/* Accueil : le pré. */
.hero { position: relative; overflow: hidden; min-height: 100svh; display: flex; }
.decor { position: absolute; inset: 0; width: 100%; height: 100%; }
.decor-haut { display: none; }
.hero-in {
  position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 120px clamp(16px, 4vw, 40px) 48px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center;
}
.pitch { align-self: start; padding-top: 4vh; }
.plaque { padding: 8px 16px; font-size: 1rem; color: var(--encre-douce); margin-bottom: 20px; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 1.06; }
.h1-suite { display: block; }
.mochi-mot { color: var(--crin); position: relative; white-space: nowrap; }
.mochi-mot::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.06em; height: .16em; border-radius: 8px; background: var(--piece); z-index: -1; }
.chapo { font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.45; margin: 20px 0 28px; max-width: 36ch; color: var(--encre); }
.appel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.badge { cursor: default; }
.plateformes { font-size: 1.05rem; color: var(--encre-douce); background: #fffcefb0; padding: 6px 12px; border-radius: 14px; }

/* Le mini-jeu : bulle de question, Mochi, feuille de réponses. */
.jeu { display: grid; justify-items: center; align-self: end; position: relative; }
.bulle {
  position: relative; z-index: 2; justify-self: start; margin-left: 4%; background: var(--carte); border-radius: var(--rayon); padding: 14px 20px 16px;
  border: 2px solid #fff; border-bottom: 5px solid #24464b1f; box-shadow: 0 10px 30px #24464b1a; max-width: 320px;
}
.bulle::after { content: ""; position: absolute; left: 56%; bottom: -16px; border: 12px solid transparent; border-top-color: var(--carte); border-bottom: 0; }
.bulle-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progression { display: flex; gap: 6px; }
.niveau { font-weight: 600; font-size: .9rem; color: var(--bourse-encre); background: var(--bourse); border: 1px solid #c6933670; border-radius: 10px; padding: 2px 9px; }
.progression i { width: 22px; height: 9px; border-radius: 8px; background: #dfe7d9; transition: background .3s; }
.progression i.fait { background: #5379ad; }
.question { font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.mochi-scene { all: unset; position: relative; cursor: pointer; width: min(340px, 80%); margin: 4px 0 -18px; -webkit-tap-highlight-color: transparent; }
.mochi-scene::after { content: ""; position: absolute; z-index: -1; left: 18%; right: 22%; bottom: 2%; height: 9%; border-radius: 50%; background: #315f4630; }
.mochi-scene:focus-visible { outline: 3px solid var(--choisi-bord); outline-offset: 6px; border-radius: 24px; }
.mochi { width: 100%; height: auto; overflow: visible; display: block; }
.feuille {
  position: relative; z-index: 2; width: 100%; max-width: 460px; background: var(--surface); border-radius: 32px; padding: 20px;
  border-top: 2px solid #fff; box-shadow: 0 18px 50px #1d33302e;
}
.consigne { color: var(--encre-douce); font-size: 1rem; margin-bottom: 12px; }
.choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choix button {
  min-height: 72px; border-radius: var(--rayon); border: 1px solid var(--bord); border-bottom: 5px solid var(--bord);
  background: var(--carte); color: var(--encre); font: 400 1.6rem Fredoka, sans-serif; cursor: pointer; transition: transform .12s, background .2s;
}
.choix button:hover:not(:disabled) { background: var(--choisi); border-color: var(--choisi-bord); }
.choix button:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 2px; }
.choix button:focus-visible { outline: 3px solid var(--choisi-bord); outline-offset: 2px; }
.choix button.juste { background: var(--juste); border-color: var(--juste-bord); color: var(--juste-encre); font-weight: 600; }
.choix button.ecarte { background: var(--gris); border-color: var(--gris-bord); color: var(--gris-encre); }
.choix button:disabled { cursor: default; }
.retour:empty { display: none; }
.retour { margin-top: 12px; font-size: 1.1rem; line-height: 1.35; }
.retour strong { font-weight: 600; font-size: 1.3rem; }
.retour.bravo strong { color: var(--juste-encre); }
.suite { width: 100%; margin-top: 12px; }

/* Bandeau d'ardoise qui défile. */
.ardoise { background: var(--ardoise); border-block: 6px solid var(--cadre); overflow: hidden; padding: 18px 0; transform: rotate(-1.2deg); margin: -14px -10px 0; position: relative; z-index: 2; }
.defile { display: flex; width: max-content; animation: defile 38s linear infinite; }
.defile span { color: #fffcef; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 600; padding: 0 28px; white-space: nowrap; opacity: .92; }
.defile span::after { content: "✦"; color: var(--piece); margin-left: 56px; font-size: .7em; vertical-align: middle; }

/* Sections. */
main section { padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 40px); }
.sur-titre { text-align: center; color: var(--accent); font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; text-align: center; max-width: 18ch; margin: 0 auto; }
h3 { font-size: 1.45rem; line-height: 1.2; }

.etapes { list-style: none; padding: 0; margin: 56px auto 0; max-width: 1100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.etapes li { display: grid; justify-items: center; text-align: center; position: relative; }
.etapes li:nth-child(2) { margin-top: 48px; }
.etapes h3 { margin: 18px 0 8px; }
.etapes p { color: var(--encre-douce); font-size: 1.1rem; line-height: 1.5; max-width: 32ch; }
.num {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin-top: -30px; position: relative; z-index: 1;
  background: var(--piece); border: 3px solid var(--piece-bord); color: var(--bourse-encre); font-weight: 700; font-size: 1.5rem;
}
.tel {
  margin: 0; width: min(260px, 72vw); aspect-ratio: 560 / 1091; border-radius: 38px; padding: 9px; background: var(--encre);
  box-shadow: 0 2px 0 3px #ffffff40 inset, 0 30px 60px -20px #1d333066, 0 12px 24px -12px #1d333040; position: relative;
}
.tel::before { content: ""; position: absolute; top: 18px; left: 50%; width: 56px; height: 7px; margin-left: -28px; border-radius: 6px; background: #263f3e; z-index: 1; opacity: .9; }
.tel img { width: 100%; height: 100%; border-radius: 30px; object-fit: cover; }
.etapes li:nth-child(1) .tel { rotate: -3deg; }
.etapes li:nth-child(3) .tel { rotate: 3deg; }

.atouts { background: var(--feuille-juste); position: relative; margin-top: 40px; }
.vague { position: absolute; left: 0; top: -58px; width: 100%; height: 60px; fill: var(--feuille-juste); }
.cartes { list-style: none; padding: 0; margin: 48px auto 0; max-width: 1100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.carte { background: var(--carte); border-radius: 26px; border: 1px solid var(--feuille-juste-bord); border-bottom: 5px solid var(--feuille-juste-bord); padding: 24px; transition: transform .25s; }
.carte:hover { transform: translateY(-4px) rotate(-.6deg); }
.carte:nth-child(even):hover { transform: translateY(-4px) rotate(.6deg); }
.pastille { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--choisi); font-size: 1.9rem; margin-bottom: 14px; }
.carte:nth-child(3n+2) .pastille { background: var(--bourse); }
.carte:nth-child(3n) .pastille { background: #dfedf4; }
.carte h3 { margin-bottom: 8px; }
.carte p { color: var(--encre-douce); font-size: 1.08rem; line-height: 1.5; }

.recompenses { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; max-width: 1200px; margin: 0 auto; }
.recompenses .sur-titre, .recompenses h2 { text-align: left; margin-left: 0; }
.recompenses-texte > p:not(.sur-titre) { font-size: 1.15rem; line-height: 1.6; color: var(--encre-douce); margin: 20px 0 24px; max-width: 46ch; }
.pilules { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pilules li { background: var(--carte); border: 1px solid var(--bord); border-bottom: 4px solid var(--bord); border-radius: 999px; padding: 8px 16px; font-size: 1.05rem; }
.eventail { position: relative; height: 560px; }
.eventail .tel { position: absolute; top: 40px; left: 50%; width: 230px; margin-left: -115px; }
.eventail .tel:nth-child(1) { translate: -160px 30px; rotate: -10deg; }
.eventail .tel:nth-child(2) { z-index: 1; translate: 0 0; }
.eventail .tel:nth-child(3) { translate: 160px 30px; rotate: 10deg; }

.final { position: relative; overflow: hidden; text-align: center; background: linear-gradient(170deg, #f1d396, #edf2da); display: grid; justify-items: center; gap: 16px; padding-bottom: 96px !important; }
.final .rayons { position: absolute; width: 1600px; height: 1600px; left: 50%; top: 330px; margin: -800px 0 0 -800px; opacity: .3; animation: tourne 60s linear infinite; }
.final > :not(.rayons) { position: relative; }
.final .mochi-scene { width: min(300px, 70vw); margin: 0 0 8px; cursor: default; }
.final p { font-size: 1.2rem; line-height: 1.5; max-width: 40ch; color: var(--encre); }
.final .badge { margin-top: 8px; }

.pied .signature { font-weight: 600; color: var(--encre); margin-bottom: 4px; }
.pied { text-align: center; padding: 28px 16px 36px; color: var(--encre-douce); font-size: 1rem; background: #edf2da; }

/* Mochi vivant : respire, cligne, bouge les oreilles ; bondit quand on le touche. */
.m-corps { transform-box: view-box; transform-origin: 180px 256px; animation: respire 1.9s ease-in-out infinite alternate; }
.m-yeux { transform-box: fill-box; transform-origin: center; animation: cligne 5.2s infinite; }
.m-oreille-g { transform-box: view-box; transform-origin: 180px 88px; animation: oreille-g 1.3s ease-in-out infinite alternate; }
.m-oreille-d { transform-box: view-box; transform-origin: 240px 88px; animation: oreille-d 1.3s ease-in-out infinite alternate; }
.m-chapeau { display: none; }
.fete .m-chapeau { display: inline; }
.fete .m-toupet, .fete .m-meche { transform-box: view-box; transform-origin: 230px 110px; animation: ondule .75s ease-in-out infinite alternate; }
.mochi-scene .mochi { transition: transform .2s; }
.mochi-scene.saute .mochi { animation: saute .9s; }
.mochi-scene.doute .mochi { animation: doute .7s; }
.mot {
  position: absolute; left: 62%; top: -2%; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 1.05rem; font-weight: 600;
  background: var(--choisi); color: #4a3590; border: 1px solid var(--choisi-bord); border-radius: 16px; padding: 6px 12px; animation: dit 1.8s ease-out forwards;
}

/* Décor animé. */
.halo { animation: halo 3.2s ease-in-out infinite alternate; }
.nuages { animation: nuages 7s ease-in-out infinite alternate; }
.arbre { transform-box: fill-box; transform-origin: 50% 100%; animation: balance 2.6s ease-in-out infinite alternate; }
.fleur { transform-box: fill-box; transform-origin: 50% 100%; animation: balance-fleur 2.6s ease-in-out infinite alternate; }
.fleur:nth-of-type(2n) { animation-delay: -1.3s; }
.papillon { animation: papillon 16s ease-in-out infinite; }
.oiseaux { animation: oiseaux 24s linear infinite; }

/* Apparition au défilement (seulement si le script tourne). */
.js .apparait { opacity: 0; translate: 0 40px; transition: opacity .7s, translate .7s cubic-bezier(.2, .9, .3, 1.2); }
.js .apparait.vu { opacity: 1; translate: 0 0; }
.js .eventail .tel.apparait { translate: 0 80px; }
.js .eventail .tel.apparait.vu:nth-child(1) { translate: -160px 30px; }
.js .eventail .tel.apparait.vu:nth-child(2) { translate: 0 0; transition-delay: .12s; }
.js .eventail .tel.apparait.vu:nth-child(3) { translate: 160px 30px; transition-delay: .24s; }
.cartes .carte:nth-child(3n+2) { transition-delay: .08s; }
.cartes .carte:nth-child(3n) { transition-delay: .16s; }

@keyframes respire { to { transform: scale(1.012, 1.022); } }
@keyframes cligne { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.1); } }
@keyframes oreille-g { to { transform: rotate(-3.4deg); } }
@keyframes oreille-d { to { transform: rotate(4.6deg); } }
@keyframes ondule { from { transform: rotate(-1.7deg); } to { transform: rotate(1.7deg); } }
@keyframes saute { 0% { transform: none; } 28% { transform: translateY(-16%) scale(.98, 1.03); } 52% { transform: translateY(0) scale(1.03, .96); } 70% { transform: translateY(-7%); } 100% { transform: none; } }
@keyframes doute { 0%, 100% { transform: none; } 30% { transform: rotate(-4deg); } 65% { transform: rotate(3deg); } }
@keyframes dit { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes monte { from { opacity: 1; transform: translateY(0) scale(.6); } to { opacity: 0; transform: translateY(-90px) scale(1.2); } }
@keyframes pop { 40% { transform: scale(1.22); } }
@keyframes halo { from { opacity: .22; } to { opacity: .52; } }
@keyframes nuages { to { transform: translateX(28px); } }
@keyframes balance { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
@keyframes balance-fleur { from { transform: rotate(-3.4deg); } to { transform: rotate(3.4deg); } }
@keyframes papillon { 0% { transform: translate(120px, 520px); } 25% { transform: translate(480px, 440px); } 50% { transform: translate(860px, 560px); } 75% { transform: translate(560px, 620px); } 100% { transform: translate(120px, 520px); } }
@keyframes oiseaux { from { transform: translate(-80px, 130px); } to { transform: translate(1520px, 90px); } }
@keyframes defile { to { transform: translateX(-50%); } }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Tablette et téléphone. */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 104px; gap: 8px; }
  .pitch { padding-top: 0; }
  .etapes { grid-template-columns: 1fr; gap: 64px; }
  .etapes li:nth-child(2) { margin-top: 0; }
  .cartes { grid-template-columns: 1fr 1fr; }
  .recompenses { grid-template-columns: 1fr; }
  .recompenses .sur-titre, .recompenses h2 { text-align: center; margin: 0 auto; }
  .recompenses .sur-titre { margin-bottom: 10px; }
  .recompenses-texte > p:not(.sur-titre) { margin-inline: auto; text-align: center; }
  .pilules { justify-content: center; }
}
@media (max-width: 640px) {
  .decor-large { display: none; }
  .decor-haut { display: block; }
  .marque { font-size: 1.2rem; }
  .marque img { width: 38px; height: 38px; }
  h1 { font-size: 2.35rem; }
  .chapo { margin: 14px 0 20px; }
  .bouton, .badge { min-height: 60px; font-size: 1.25rem; }
  .mochi-scene { width: 74%; }
  .bulle { margin-left: 0; justify-self: center; }
  .question { font-size: 1.35rem; }
  .feuille { padding: 16px; border-radius: 28px; }
  .cartes { grid-template-columns: 1fr; }
  /* Étapes : carrousel qu'on fait glisser. */
  .etapes { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin: 40px -16px 0; padding: 12px 16px 24px; scrollbar-width: none; }
  .etapes::-webkit-scrollbar { display: none; }
  .etapes li { flex: 0 0 82%; scroll-snap-align: center; }
  .etapes .tel { width: 220px; }
  .eventail { height: 470px; }
  .eventail .tel { width: 190px; margin-left: -95px; }
  .eventail .tel:nth-child(1), .js .eventail .tel.apparait.vu:nth-child(1) { translate: -90px 40px; }
  .eventail .tel:nth-child(3), .js .eventail .tel.apparait.vu:nth-child(3) { translate: 90px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .apparait { opacity: 1; translate: none; }
  .js .eventail .tel.apparait:nth-child(2) { translate: 0 0; }
}

/* Pages simples (404, pages à venir). */
.simple { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px 16px 48px; background: linear-gradient(170deg, #9cd4e9, #edf2da 70%); position: relative; overflow: hidden; }
.simple::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -55vh; height: 80vh; border-radius: 50%; background: linear-gradient(#a8c790, #7fa879); z-index: 0; }
.simple main { position: relative; z-index: 1; max-width: 560px; display: grid; justify-items: center; gap: 14px; }
.simple .mochi-scene { width: min(280px, 70vw); cursor: default; }
.simple h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); }
.simple p { font-size: 1.25rem; line-height: 1.5; }
.doute-fixe .mochi { rotate: -5deg; }
