/* SIPA — site vitrine
   Identité reprise de l'app : or, beige, gris foncé, rouge, fond en dégradé prune → brun. */

:root {
  --or: #E2A655;
  --or-clair: #F1C98A;
  --or-fonce: #B9803A;
  --beige: #F2E6C9;
  --gris: #2E2E2E;
  --rouge: #D25B42;
  --fond-1: #3B2C37;
  --fond-2: #201D1D;

  --texte: #F7EFE0;
  --texte-doux: rgba(242, 230, 201, 0.74);
  --texte-faible: rgba(242, 230, 201, 0.55);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-forte: rgba(255, 255, 255, 0.075);
  --bordure: rgba(226, 166, 85, 0.2);
  --bordure-forte: rgba(226, 166, 85, 0.45);

  --rayon-s: 12px;
  --rayon: 16px;
  --rayon-l: 24px;
  --ombre: 0 18px 40px rgba(0, 0, 0, 0.35);
  --ombre-or: 0 12px 32px rgba(226, 166, 85, 0.25);

  --titre: 'Baloo 2', ui-rounded, system-ui, sans-serif;
  --corps: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --largeur: 1180px;
  --gouttiere: clamp(16px, 4vw, 32px);
  --entete: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--entete) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--corps);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--texte);
  background: var(--fond-2);
  overflow-x: hidden;
}

/* Dégradé de l'app, fixé derrière la page (background-attachment: fixed est mal géré sur mobile) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(226, 166, 85, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, rgba(210, 91, 66, 0.09), transparent 60%),
    linear-gradient(160deg, var(--fond-1) 0%, var(--fond-2) 70%);
}

/* Motif discret de couleurs de cartes */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23F2E6C9' font-family='serif' font-size='22'%3E%3Ctext x='10' y='30'%3E%E2%99%A0%3C/text%3E%3Ctext x='70' y='30'%3E%E2%99%A5%3C/text%3E%3Ctext x='40' y='90'%3E%E2%99%A6%3C/text%3E%3Ctext x='100' y='90'%3E%E2%99%A3%3C/text%3E%3C/g%3E%3C/svg%3E");
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--or);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--or-clair);
}

:focus-visible {
  outline: 3px solid var(--or-clair);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--titre);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--rayon-s);
  background: var(--or);
  color: var(--gris);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(100% - 2 * var(--gouttiere), var(--largeur));
  margin-inline: auto;
}

/* ---------- En-tête ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(32, 29, 29, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--bordure);
  background: rgba(32, 29, 29, 0.88);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--entete);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--texte);
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  margin-right: auto;
}

.brand:hover {
  color: var(--or-clair);
}

.brand img {
  width: 40px;
  height: 40px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--texte-doux);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-list a:hover,
.nav-list a[aria-current='page'] {
  color: var(--or);
  background: rgba(226, 166, 85, 0.1);
}

.nav-list a.nav-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--or);
  font-weight: 700;
}

.nav-top svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--rayon-s);
  border: 1px solid var(--bordure);
  background: var(--surface);
  color: var(--texte);
  cursor: pointer;
  padding: 0;
  place-items: center;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded='true'] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

@media (max-width: 899px) {
  .menu-toggle {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: var(--entete);
    left: 0;
    right: 0;
    padding: 12px var(--gouttiere) 20px;
    background: #231e20;
    border-bottom: 1px solid var(--bordure);
    box-shadow: var(--ombre);
  }

  .js .site-nav:not(.is-open) {
    display: none;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-list a.nav-top {
    display: flex;
  }

  .nav-list a {
    padding: 12px 14px;
    border-radius: var(--rayon-s);
    font-size: 1.05rem;
  }
}

/* Top 100 toujours visible sous 900 px, quand les autres liens passent dans le menu */
.header-top {
  display: none;
}

@media (max-width: 899px) {
  .header-top {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--bordure-forte);
    background: rgba(226, 166, 85, 0.1);
    color: var(--or);
    font-family: var(--titre);
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .header-top[aria-current='page'] {
    border-color: var(--or);
    background: rgba(226, 166, 85, 0.22);
  }

  .header-top svg {
    width: 15px;
    height: 15px;
    flex: none;
  }

  .header-top:hover {
    color: var(--or-clair);
  }
}

/* Téléphone : le logo seul, pour laisser la place à Top 100, Télécharger et au menu */
@media (max-width: 479px) {
  .site-header .container {
    gap: 8px;
  }

  .site-header .brand {
    gap: 0;
    font-size: 0;
  }

  .site-header .header-cta {
    padding-inline: 12px;
    font-size: 0.88rem;
  }
}

@media (max-width: 359px) {
  .site-header .header-cta {
    display: none;
  }
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--gris);
  box-shadow: var(--ombre-or);
}

.btn-primary:hover {
  color: var(--gris);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(226, 166, 85, 0.35);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--bordure-forte);
  color: var(--beige);
}

.btn-ghost:hover {
  color: var(--or-clair);
  background: rgba(226, 166, 85, 0.1);
  transform: translateY(-2px);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* Badges des stores */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding: 10px 20px 10px 16px;
  border-radius: var(--rayon);
  background: #0f0d0e;
  border: 1px solid rgba(242, 230, 201, 0.22);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-badge:hover {
  color: #fff;
  transform: translateY(-2px);
  border-color: var(--or);
  box-shadow: var(--ombre-or);
}

.store-badge svg {
  width: 28px;
  height: 28px;
  flex: none;
  fill: currentColor;
}

.store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-badge small {
  font-size: 0.72rem;
  opacity: 0.8;
}

.store-badge strong {
  font-family: var(--titre);
  font-size: 1.22rem;
  font-weight: 700;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 100px);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--bordure);
  background: rgba(226, 166, 85, 0.08);
  color: var(--or);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  color: var(--beige);
}

.section-title em {
  font-style: normal;
  color: var(--or);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--texte-doux);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: clamp(32px, 6vw, 72px);
  padding-bottom: clamp(56px, 8vw, 100px);
}

.hero .container {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  color: var(--beige);
  margin-bottom: 20px;
}

.hero h1 .gold {
  display: block;
  background: linear-gradient(100deg, var(--or-clair) 0%, var(--or) 45%, var(--rouge) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--texte-faible);
  font-size: 0.92rem;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-facts li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--or);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
  isolation: isolate;
}

.hero-visual::before {
  content: '';
  position: absolute;
  width: min(480px, 90%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 166, 85, 0.35), rgba(226, 166, 85, 0) 65%);
  z-index: -1;
}

.hero-visual .phone {
  width: min(270px, 64vw);
  transform: rotate(4deg);
}

.hero-wiyao {
  position: absolute;
  left: max(0px, calc(50% - 300px));
  bottom: -8px;
  width: min(190px, 40vw);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  cursor: pointer;
}

.hero-visual .bubble {
  position: absolute;
  z-index: 3;
  left: max(0px, calc(50% - 310px));
  bottom: min(250px, 52vw);
}

.bubble {
  max-width: 200px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--beige);
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  box-shadow: var(--ombre);
}

.hero-cards {
  position: absolute;
  z-index: 2;
  right: max(0px, calc(50% - 290px));
  top: 10px;
  width: 160px;
  height: 140px;
}

/* Éventail : les trois cartes pivotent autour d'un même point, sous la main */
.hero-cards .playing-card {
  position: absolute;
  top: 10px;
  left: 44px;
  transform-origin: 50% 160%;
}

.hero-cards .playing-card {
  transform: rotate(var(--r, 0deg));
}

.hero-cards .playing-card:nth-child(1) {
  --r: -18deg;
}

.hero-cards .playing-card:nth-child(3) {
  --r: 18deg;
}

@media (max-width: 520px) {
  .hero-visual {
    min-height: 400px;
  }

  .hero-cards {
    transform: scale(0.8);
    transform-origin: top right;
    right: -6px;
  }

  .hero-visual .bubble {
    max-width: 150px;
    font-size: 0.85rem;
    bottom: 190px;
  }

  .hero-wiyao {
    width: 130px;
    left: -6px;
  }
}


@keyframes flotter {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -10px;
  }
}

/* ---------- Téléphone (cadre des captures) ---------- */

.phone {
  position: relative;
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(145deg, #4a3a44, #171415);
  box-shadow:
    0 0 0 1px rgba(226, 166, 85, 0.35),
    0 30px 60px rgba(0, 0, 0, 0.55);
}

.phone img {
  width: 100%;
  aspect-ratio: 520 / 1131;
  object-fit: cover;
  border-radius: 30px;
  background: var(--fond-1);
}

/* ---------- Cartes à jouer en CSS ---------- */

.playing-card {
  --c: var(--gris);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  background: linear-gradient(160deg, #fffaf0, var(--beige));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  color: var(--c);
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1;
}

.playing-card.red {
  --c: var(--rouge);
}

.playing-card .rank {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 1.15rem;
  text-align: center;
}

.playing-card .rank::after {
  content: attr(data-suit);
  display: block;
  font-size: 0.8em;
}

/* Index répété en bas à droite, tête-bêche comme sur une vraie carte */
.playing-card .rank-br {
  top: auto;
  left: auto;
  bottom: 6px;
  right: 8px;
  transform: rotate(180deg);
}

.playing-card .suit {
  font-size: 2rem;
}

/* ---------- Bandeau de chiffres ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: var(--rayon-l);
  border: 1px solid var(--bordure);
  background: var(--bordure);
}

@media (min-width: 760px) {
  .facts {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fact {
  padding: 22px 20px;
  background: rgba(36, 30, 32, 0.92);
  text-align: center;
}

.fact strong {
  display: block;
  font-family: var(--titre);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.1;
  color: var(--or);
}

.fact span {
  color: var(--texte-doux);
  font-size: 0.93rem;
}

/* ---------- Le jeu en 30 secondes : étapes + table en 3D (js/table3d.js) ---------- */

.jeu-collant {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .jeu-collant {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 48px;
  }

  /* Grand écran : la scène reste collée pendant que le défilement fait avancer la donne */
  .jeu-zone[data-mode='defilement'] {
    height: 290vh;
  }

  .jeu-zone[data-mode='defilement'] .jeu-collant {
    position: sticky;
    top: var(--entete);
    min-height: calc(100vh - var(--entete));
  }
}

.jeu-etapes {
  position: relative;
  padding-left: 26px;
}

.jeu-rail {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--bordure);
  overflow: hidden;
}

.jeu-fil {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--or-clair), var(--or));
}

.jeu-etapes ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jeu-etape {
  padding: 12px 0;
}

.jeu-num {
  margin: 0 0 4px;
  color: var(--or);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.jeu-etape h3 {
  margin-bottom: 4px;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  color: var(--beige);
  transition: color 450ms var(--ease);
}

.jeu-etape p:last-child {
  margin: 0;
  max-width: 42ch;
  color: var(--texte-doux);
  transition: color 450ms var(--ease);
}

.jeu-zone[data-mode='defilement'] .jeu-etape:not([data-actif]) h3,
.jeu-zone[data-mode='unefois'] .jeu-etape:not([data-actif]) h3 {
  color: rgba(242, 230, 201, 0.4);
}

.jeu-zone[data-mode='defilement'] .jeu-etape:not([data-actif]) p:last-child,
.jeu-zone[data-mode='unefois'] .jeu-etape:not([data-actif]) p:last-child {
  color: rgba(242, 230, 201, 0.35);
}

html:not(.js) .jeu-scene {
  display: none;
}

.jeu-zone {
  overflow-x: clip;
}

.jeu-scene {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(400px * var(--echelle, 1));
}

/* Plateau vu en isométrique : aucune perspective, comme une maquette. Centré hors du flux pour que sa largeur
   avant mise à l'échelle (--echelle, posée par js/table3d.js) n'élargisse pas la page. */
.table3d {
  position: absolute;
  left: calc(50% + 46px * var(--echelle, 1));
  top: calc(50% + 14px * var(--echelle, 1));
  width: 440px;
  height: 300px;
  margin: -150px 0 0 -220px;
  transform-style: preserve-3d;
  transform: scale(var(--echelle, 1)) rotateX(55deg) rotateZ(-30deg);
}

.table3d__plateau {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 214, 150, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 50%, #b8763a 0%, #95592a 60%, #6f3f1e 100%);
  box-shadow:
    inset 0 0 0 10px #4a2e1f,
    inset 0 0 0 12px rgba(226, 166, 85, 0.65);
}

.table3d__face {
  position: absolute;
  background: #3a2418;
}

.table3d__face--avant {
  left: 0;
  top: 300px;
  width: 440px;
  height: 18px;
  transform-origin: top;
  transform: rotateX(-90deg);
  background: linear-gradient(90deg, #2c1b12, #43291b);
}

.table3d__face--droite {
  left: 0;
  top: 0;
  width: 18px;
  height: 300px;
  transform-origin: left;
  transform: rotateY(90deg);
  background: #24160f;
}

.table3d__nom {
  position: absolute;
  left: 34px;
  font-family: var(--titre);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 236, 200, 0.6);
}

.table3d__nom--haut {
  top: 38px;
}

.table3d__nom--bas {
  top: 244px;
}

/* Le « +2 » fait face au visiteur : il annule la rotation de la table */
.table3d__points {
  position: absolute;
  left: 0;
  top: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
  opacity: 0;
  transform: translate3d(262px, 222px, 24px) rotateZ(30deg) rotateX(-55deg) scale(var(--pop, 0.4));
  box-shadow: var(--ombre-or);
}

.c3d {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 64px;
  transform-style: preserve-3d;
  will-change: transform;
}

.c3d__face,
.c3d__dos {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.c3d__face {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fffaf0, var(--beige));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 800;
  transition: box-shadow 300ms var(--ease);
}

.c3d--rouge .c3d__face {
  color: var(--rouge);
}

.c3d__i {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.c3d__i--bas {
  top: auto;
  left: auto;
  bottom: 3px;
  right: 4px;
  transform: rotate(180deg);
}

.c3d__s {
  font-size: 22px;
  line-height: 1;
}

.c3d__dos {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle, var(--or) 0 4px, transparent 5px),
    repeating-linear-gradient(45deg, rgba(226, 166, 85, 0.22) 0 2px, transparent 2px 7px),
    #3b2c37;
  box-shadow: inset 0 0 0 3px #3b2c37, inset 0 0 0 4px var(--or);
}

.c3d[data-gagne] .c3d__face {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 0 0 2px var(--or), 0 0 22px rgba(226, 166, 85, 0.85);
}

.jeu-rejouer {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--bordure-forte);
  background: rgba(32, 29, 29, 0.8);
  color: var(--beige);
  font: 600 0.9rem var(--corps);
  cursor: pointer;
}

.jeu-rejouer:hover {
  color: var(--or-clair);
}

.jeu-rejouer svg {
  width: 16px;
  height: 16px;
}

.jeu-rejouer[hidden] {
  display: none;
}

/* ---------- Ordre des cartes ---------- */

.rank-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: clamp(32px, 5vw, 48px) 0 0;
  padding: 0;
  list-style: none;
}

.rank-strip li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-strip li + li::before {
  content: '>';
  color: var(--or);
  font-family: var(--titre);
  font-weight: 800;
}

.rank-strip .playing-card {
  width: 56px;
}

.rank-strip .playing-card .rank {
  font-size: 0.85rem;
  top: 5px;
  left: 6px;
}

.rank-strip .playing-card .rank-br {
  top: auto;
  left: auto;
  bottom: 5px;
  right: 6px;
}

.rank-strip .playing-card .suit {
  font-size: 1.25rem;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

/* ---------- Blocs de fonctionnalités ---------- */

.feature {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.feature + .feature {
  margin-top: clamp(72px, 10vw, 128px);
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: 1fr 1fr;
  }

  .feature.reverse .feature-media {
    order: 2;
  }
}

.feature-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  isolation: isolate;
}

.feature-media::before {
  content: '';
  position: absolute;
  inset: 8% 6%;
  z-index: -1;
  border-radius: 40px;
  background:
    radial-gradient(circle at 30% 20%, rgba(226, 166, 85, 0.22), transparent 60%),
    var(--surface);
  border: 1px solid var(--bordure);
}

.feature-media .phone {
  width: min(250px, 62vw);
}

.feature h3 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  color: var(--beige);
}

.feature p {
  color: var(--texte-doux);
}

.checklist {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.checklist li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
}

.checklist .ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(226, 166, 85, 0.12);
  color: var(--or);
}

.checklist .ico svg {
  width: 20px;
  height: 20px;
}

.checklist strong {
  display: block;
  color: var(--beige);
  font-family: var(--titre);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
}

.checklist span {
  color: var(--texte-doux);
  font-size: 0.97rem;
}

/* Solo : Wiyao */
.wiyao-stage {
  position: relative;
  width: min(380px, 90%);
}

.wiyao-stage .wiyao-vivant {
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5));
}

.bubble--stage {
  position: absolute;
  z-index: 2;
  top: 2%;
  right: -6%;
  max-width: 220px;
  border-radius: 16px 16px 4px 16px;
}

@media (max-width: 520px) {
  .bubble--stage {
    top: -6%;
    right: 0;
    max-width: 170px;
    font-size: 0.88rem;
  }
}

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.level {
  width: 100%;
  padding: 14px 12px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 1px solid var(--bordure);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.level:hover {
  border-color: var(--bordure-forte);
  transform: translateY(-2px);
}

.level[aria-pressed='true'] {
  border-color: var(--or);
  background: rgba(226, 166, 85, 0.12);
}

.level strong {
  display: block;
  font-family: var(--titre);
  font-size: 1.1rem;
  color: var(--beige);
}

.level .pips {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
}

.level .pips i {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  background: rgba(242, 230, 201, 0.18);
}

.level .pips i.on {
  background: var(--or);
}

/* Tournoi : mini tableau */
.bracket {
  position: absolute;
  right: 2%;
  bottom: 6%;
  width: 190px;
  padding: 14px;
  border-radius: var(--rayon);
  background: rgba(32, 29, 29, 0.92);
  border: 1px solid var(--bordure-forte);
  box-shadow: var(--ombre);
  font-size: 0.8rem;
}

.bracket p {
  margin: 0 0 8px;
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or);
  font-size: 0.95rem;
}

.bracket ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.bracket li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-forte);
  color: var(--texte-doux);
}

.bracket li b {
  color: var(--beige);
  font-weight: 700;
}

.bracket li.win {
  background: rgba(226, 166, 85, 0.16);
  color: var(--or-clair);
}

@media (max-width: 520px) {
  .bracket {
    right: 0;
    width: 160px;
  }
}

/* ---------- Boutique ---------- */

.shop-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .shop-grid {
    grid-template-columns: 1.3fr 1fr;
    grid-template-rows: auto auto;
  }

  .shop-grid .shop-card:first-child {
    grid-row: span 2;
  }
}

.shop-card {
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--rayon-l);
  background: var(--surface);
  border: 1px solid var(--bordure);
  overflow: hidden;
}

.shop-card h3 {
  font-size: 1.4rem;
  color: var(--beige);
  margin-bottom: 4px;
}

.shop-card > p {
  color: var(--texte-doux);
  font-size: 0.97rem;
}

.card-backs {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.card-backs img {
  width: clamp(76px, 15vw, 120px);
  aspect-ratio: 240 / 351;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  margin-inline: -14px;
  transition: transform 0.3s ease;
}

.card-backs img:nth-child(1) { transform: rotate(-14deg) translateY(18px); }
.card-backs img:nth-child(2) { transform: rotate(-7deg) translateY(5px); }
.card-backs img:nth-child(3) { transform: rotate(0deg); z-index: 1; }
.card-backs img:nth-child(4) { transform: rotate(7deg) translateY(5px); }
.card-backs img:nth-child(5) { transform: rotate(14deg) translateY(18px); }

.avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.avatars li {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(226, 166, 85, 0.28), rgba(59, 44, 55, 0.9));
  border: 2px solid var(--bordure-forte);
  overflow: hidden;
}

.avatars img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.tables {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.tables img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--rayon-s);
  border: 1px solid var(--bordure);
}

.lidiyes {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--rayon-l);
  border: 1px solid var(--bordure-forte);
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(226, 166, 85, 0.18), transparent 70%),
    rgba(36, 30, 32, 0.85);
}

@media (min-width: 900px) {
  .lidiyes {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
  }
}

.lidiyes h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
  color: var(--beige);
}

.lidiyes p {
  color: var(--texte-doux);
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-forte);
  border: 1px solid var(--bordure);
  color: var(--beige);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- Galerie ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(230px, 62vw);
  gap: 20px;
  overflow-x: auto;
  padding: 8px var(--gouttiere) 24px;
  margin: 0;
  list-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gouttiere);
  scrollbar-width: thin;
  scrollbar-color: var(--or-fonce) transparent;
}

@media (min-width: 1240px) {
  .gallery {
    justify-content: center;
  }
}

.gallery li {
  scroll-snap-align: start;
}

.gallery figure {
  margin: 0;
}

.gallery figcaption {
  margin-top: 14px;
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.93rem;
}

.gallery figcaption strong {
  display: block;
  color: var(--beige);
  font-family: var(--titre);
  font-size: 1.1rem;
}

/* ---------- Avis ---------- */

.reviews {
  columns: 1;
  column-gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .reviews {
    columns: 2;
  }
}

@media (min-width: 1000px) {
  .reviews {
    columns: 3;
  }
}

.review {
  break-inside: avoid;
  margin: 0 0 16px;
  padding: 20px 22px;
  border-radius: var(--rayon-l);
  background: var(--surface);
  border: 1px solid var(--bordure);
}

.review blockquote {
  margin: 0 0 14px;
  font-size: 1.04rem;
  color: var(--texte);
}

.review figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--or);
  font-weight: 600;
  font-size: 0.95rem;
}

.review .initial {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(226, 166, 85, 0.16);
  color: var(--or-clair);
  font-family: var(--titre);
  font-weight: 800;
}

.stars {
  color: var(--or);
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* ---------- Appel à l'action final ---------- */

.cta-final {
  position: relative;
  display: grid;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 32px;
  border: 1px solid var(--bordure-forte);
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(226, 166, 85, 0.25), transparent 70%),
    radial-gradient(500px 300px at 0% 100%, rgba(210, 91, 66, 0.18), transparent 70%),
    linear-gradient(160deg, #46333f, #261f21);
}

@media (min-width: 900px) {
  .cta-final {
    grid-template-columns: 1fr auto;
    padding-right: 300px;
  }
}

.cta-final h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  color: var(--beige);
}

.cta-final p {
  color: var(--texte-doux);
  margin-bottom: 24px;
}

.cta-final .wiyao,
.bubble--cta {
  display: none;
}

@media (min-width: 900px) {
  .cta-final > div {
    grid-column: 1 / -1;
  }

  .cta-final .wiyao {
    display: block;
    position: absolute;
    right: 24px;
    bottom: 0;
    width: 260px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  }

  .bubble--cta {
    display: block;
    position: absolute;
    z-index: 2;
    right: 250px;
    top: 36px;
    max-width: 190px;
    border-radius: 16px 16px 4px 16px;
  }
}

.community + .community {
  margin-left: 20px;
}

.community {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--beige);
  font-weight: 600;
}

/* ---------- Pied de page ---------- */

.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  padding: 48px 0 32px;
  border-top: 1px solid var(--bordure);
  background: rgba(20, 17, 18, 0.6);
  color: var(--texte-doux);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer .brand {
  margin-bottom: 12px;
}

.site-footer h2 {
  font-size: 1rem;
  font-family: var(--titre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.site-footer a {
  color: var(--texte-doux);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--or);
  text-decoration: underline;
}

.site-footer .reseau {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--beige);
  font-weight: 600;
}

.site-footer .reseau svg {
  color: var(--or);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(226, 166, 85, 0.12);
  color: var(--texte-faible);
  font-size: 0.88rem;
}

/* ---------- Pages de contenu (règles, confidentialité, contact) ---------- */

.page-hero {
  padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px);
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 800;
  color: var(--beige);
}

.page-hero .lead {
  max-width: 620px;
  margin-inline: auto;
}

.prose {
  max-width: 820px;
  margin-inline: auto;
  display: grid;
  gap: 20px;
}

.panel {
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--rayon-l);
  background: var(--surface);
  border: 1px solid var(--bordure);
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  color: var(--beige);
  margin-bottom: 14px;
}

.panel h2 .ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(226, 166, 85, 0.14);
  color: var(--or);
  flex: none;
}

.panel h2 .ico svg {
  width: 20px;
  height: 20px;
}

.panel h3 {
  font-size: 1.2rem;
  color: var(--or);
  margin: 22px 0 8px;
}

.panel p,
.panel li {
  color: var(--texte-doux);
}

.panel strong {
  color: var(--beige);
}

.panel ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.panel li {
  margin-bottom: 6px;
}

.panel li::marker {
  color: var(--or);
}

.panel > :last-child {
  margin-bottom: 0;
}

.hl {
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(226, 166, 85, 0.16);
  color: var(--or-clair);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hl.nw {
  white-space: nowrap;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 0.98rem;
}

.score-table th,
.score-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--bordure);
}

.score-table th {
  color: var(--or);
  font-family: var(--titre);
  font-size: 1rem;
}

.score-table td {
  color: var(--texte-doux);
}

.score-table tbody tr td {
  transition: background-color 350ms var(--ease), color 350ms var(--ease);
}

.score-table tbody tr[data-actif] td {
  background: rgba(226, 166, 85, 0.13);
  color: var(--beige);
}

.score-table td:last-child {
  text-align: right;
  white-space: nowrap;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--beige);
}

.wiyao-quote {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}

.wiyao-quote img {
  width: 96px;
}

.wiyao-quote blockquote {
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px 18px 18px 4px;
  background: var(--beige);
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
}

.contact-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px;
  border-radius: var(--rayon-l);
  background: var(--surface);
  border: 1px solid var(--bordure);
  text-decoration: none;
  color: var(--texte);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

a.contact-card:hover {
  color: var(--texte);
  transform: translateY(-3px);
  border-color: var(--bordure-forte);
  background: rgba(226, 166, 85, 0.07);
}

.contact-card .ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(226, 166, 85, 0.14);
  color: var(--or);
}

.contact-card .ico svg {
  width: 24px;
  height: 24px;
}

.contact-card h2 {
  font-size: 1.35rem;
  color: var(--beige);
  margin: 0;
}

.contact-card p {
  color: var(--texte-doux);
  font-size: 0.96rem;
  margin: 0;
  flex: 1;
}

.contact-card .link {
  color: var(--or);
  font-weight: 700;
  word-break: break-word;
}

/* ---------- Animations ----------
   Entrées en CSS pur pour le haut de page (sans attendre le JavaScript), puis apparitions au défilement
   (js/site.js pose .is-visible et --i, le rang dans le groupe, pour un décalage de 80 ms).
   Tout est coupé sous prefers-reduced-motion. */

.ligne,
.masque {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.ligne > span,
.masque > span {
  display: block;
}

@keyframes ligne-entree {
  from {
    transform: translateY(105%);
  }
}

@keyframes apparition {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes revele-bas {
  from {
    clip-path: inset(100% 0 0 0 round 38px);
  }

  to {
    clip-path: inset(0 0 0 0 round 38px);
  }
}

@keyframes pose {
  from {
    transform: scale(1.08);
  }
}

@keyframes distribue {
  from {
    opacity: 0;
    transform: translate(-90px, 170px) rotate(-50deg);
  }
}

@keyframes surgir {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.85);
  }
}

@keyframes bulle {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.6);
  }
}

@keyframes respire {
  0%,
  100% {
    transform: none;
  }

  50% {
    transform: scale(1.012, 1.024);
  }
}

@keyframes rebond {
  0% {
    transform: scale(1.07, 0.9);
  }

  45% {
    transform: scale(0.97, 1.05);
  }
}

@keyframes piece-lancee {
  from {
    transform: translateY(-26px) rotateY(-900deg);
  }
}

@keyframes piece-balance {
  0%,
  100% {
    transform: rotateY(-28deg);
  }

  50% {
    transform: rotateY(28deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ligne > span {
    animation: ligne-entree 900ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 80ms + 100ms);
  }

  .apparition {
    animation: apparition 700ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 80ms + 100ms);
  }

  .hero-visual .phone {
    animation:
      revele-bas 1100ms var(--ease) 250ms both,
      flotter 7s ease-in-out 1.4s infinite;
  }

  .hero-visual .phone img {
    animation: pose 1600ms var(--ease) 250ms both;
  }

  .hero-cards .playing-card {
    animation: distribue 800ms var(--ease) both;
  }

  .hero-cards .playing-card:nth-child(1) { animation-delay: 750ms; }
  .hero-cards .playing-card:nth-child(2) { animation-delay: 870ms; }
  .hero-cards .playing-card:nth-child(3) { animation-delay: 990ms; }

  .hero-wiyao {
    animation:
      surgir 900ms var(--ease) 950ms both,
      flotter 6s ease-in-out 2s infinite;
  }

  .hero-visual .bubble {
    animation: bulle 600ms var(--ease) 1600ms both;
  }

  .bubble {
    transform-origin: 10% 100%;
  }

  /* Wiyao réactif (js/wiyao.js) : il respire, rebondit à chaque changement d'expression, et sa bulle reparle */
  .wiyao-vivant__corps {
    animation: respire 4.2s ease-in-out infinite;
  }

  .wiyao-vivant__corps img.rebond {
    animation: rebond 560ms var(--ease);
  }

  .bubble.parle {
    animation: bulle 450ms var(--ease) both;
  }

  /* Apparitions au défilement */
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Titres de section : la ligne monte derrière un masque */
  .masque > span {
    transition: transform 900ms var(--ease) 120ms;
  }

  .js .reveal:not(.is-visible) .masque > span {
    transform: translateY(105%);
  }

  /* Captures et Wiyao des modes de jeu : dévoilés de bas en haut, puis l'image se pose */
  .js .feature-media.reveal .phone {
    transition: clip-path 1100ms var(--ease) 150ms;
  }

  .js .feature-media.reveal .phone img,
  .js .feature-media.reveal .wiyao-stage .wiyao-vivant {
    transition: transform 1600ms var(--ease) 150ms, opacity 900ms var(--ease) 150ms;
  }

  .js .feature-media.reveal:not(.is-visible) .phone {
    clip-path: inset(100% 0 0 0 round 38px);
  }

  .js .feature-media.reveal:not(.is-visible) .phone img {
    transform: scale(1.08);
  }

  .js .feature-media.reveal:not(.is-visible) .wiyao-stage .wiyao-vivant {
    opacity: 0;
    transform: translateY(50px) scale(0.92);
  }

  .js .feature-media.reveal .phone {
    clip-path: inset(0 0 0 0 round 38px);
  }

  /* Dos de cartes : l'éventail s'ouvre */
  .js .card-backs img {
    transition: transform 900ms var(--ease);
  }

  .js .shop-card:not(.is-visible) .card-backs img {
    transform: none;
  }

  .js .shop-card .card-backs img:nth-child(1) { transition-delay: 250ms; }
  .js .shop-card .card-backs img:nth-child(2) { transition-delay: 200ms; }
  .js .shop-card .card-backs img:nth-child(4) { transition-delay: 200ms; }
  .js .shop-card .card-backs img:nth-child(5) { transition-delay: 250ms; }

  /* Ordre des cartes : elles se retournent une à une à l'arrivée */
  .js .rank-strip .playing-card {
    transition: transform 700ms var(--ease), opacity 500ms var(--ease);
  }

  .js .rank-strip li:nth-child(2) .playing-card { transition-delay: 90ms; }
  .js .rank-strip li:nth-child(3) .playing-card { transition-delay: 180ms; }
  .js .rank-strip li:nth-child(4) .playing-card { transition-delay: 270ms; }
  .js .rank-strip li:nth-child(5) .playing-card { transition-delay: 360ms; }
  .js .rank-strip li:nth-child(6) .playing-card { transition-delay: 450ms; }
  .js .rank-strip li:nth-child(7) .playing-card { transition-delay: 540ms; }

  .js .rank-strip.reveal:not(.is-visible) .playing-card,
  .js .reveal:not(.is-visible) .rank-strip .playing-card {
    opacity: 0;
    transform: translateY(-24px) rotateY(90deg);
  }

  /* Pièce : lancée à l'apparition, puis se balance */
  .js .lidiyes.is-visible .piece3d__corps {
    animation:
      piece-lancee 1600ms var(--ease) 200ms both,
      piece-balance 5s ease-in-out 1.8s infinite;
  }
}

/* Symbole des Lidiyés : prend la couleur du texte */
.lid {
  display: inline-block;
  width: 0.92em;
  height: 0.92em;
  margin-left: 0.14em;
  vertical-align: -0.12em;
  background: var(--or);
  -webkit-mask: url('/assets/site/lidiye.svg') center / contain no-repeat;
  mask: url('/assets/site/lidiye.svg') center / contain no-repeat;
}

.piece3d__face .lid {
  width: 76%;
  height: 76%;
  margin: 0;
  background: currentColor;
}

/* ---------- Pièce de Lidiyé en 3D ---------- */

.piece3d {
  display: inline-block;
  width: 48px;
  height: 48px;
  flex: none;
  perspective: 400px;
}

.piece3d__corps {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(-28deg);
}

.piece3d__corps > i,
.piece3d__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

/* Tranche : disques empilés derrière la face */
.piece3d__corps > i {
  background: var(--or-fonce);
  transform: translateZ(calc(var(--z) * -1px));
}

.piece3d__corps > i:nth-child(odd) {
  background: #a06c2f;
}

.piece3d__face {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe2a8, var(--or) 55%, var(--or-fonce));
  box-shadow: inset 0 0 0 3px rgba(185, 128, 58, 0.9), inset 0 0 0 5px rgba(255, 226, 168, 0.5);
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.35rem;
  font-style: normal;
}

.piece3d__face--dos {
  transform: translateZ(-8px) rotateY(180deg);
}

/* ---------- Wiyao réactif (js/wiyao.js) ---------- */

/* les paragraphes des sections (.feature p, .cta-final p) ne doivent pas déteindre sur les bulles */
.feature .bubble,
.cta-final .bubble {
  margin: 0;
  color: var(--gris);
}

.wiyao-vivant {
  display: block;
}

.wiyao-vivant__corps {
  position: relative;
  display: block;
  aspect-ratio: 420 / 550;
  transform-origin: 50% 100%;
}

.wiyao-vivant__corps img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  transform-origin: 50% 100%;
  transition: opacity 220ms ease;
}

.wiyao-vivant__corps img.is-actif {
  opacity: 1;
}

/* À sa place, en haut à gauche de la table 3D */
.table-wiyao {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: calc(150px * var(--echelle, 1));
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.45));
}

.bubble--table {
  position: absolute;
  z-index: 3;
  left: calc(140px * var(--echelle, 1));
  top: calc(6px * var(--echelle, 1));
  max-width: 230px;
}

@media (max-width: 520px) {
  .bubble--table {
    max-width: 180px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}

/* Règles : Wiyao à côté du tableau des points */
.points-grille {
  display: grid;
  gap: 8px;
  align-items: end;
}

.points-grille .score-table {
  margin-bottom: 8px;
}

.points-wiyao {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.points-wiyao .wiyao-vivant {
  width: 110px;
  flex: none;
  order: -1;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.45));
}

.points-wiyao .bubble {
  margin-bottom: 70px;
  color: var(--gris);
}

@media (min-width: 760px) {
  .points-grille {
    grid-template-columns: 1fr 170px;
  }

  .points-wiyao {
    flex-direction: column;
    align-items: center;
  }

  .points-wiyao .wiyao-vivant {
    order: 0;
    width: 150px;
  }

  .points-wiyao .bubble {
    margin-bottom: 0;
    border-radius: 16px 16px 16px 4px;
    font-size: 0.88rem;
  }
}

/* Contact : Wiyao en mascotte au-dessus du titre */
.mascotte {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.mascotte__wiyao {
  width: clamp(96px, 18vw, 130px);
  flex: none;
  cursor: default;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.45));
}

.mascotte__bulle {
  margin-bottom: 60px;
  text-align: left;
}

@media (prefers-reduced-motion: no-preference) {
  .mascotte {
    animation: apparition 800ms var(--ease) 350ms both;
  }
}
