:root {
    color-scheme: dark;
    /* Maison Signature : mêmes teintes que le site (vert Didier, or de la signature). */
    --jasmin: #F3F5F0;
    --feuille: #2F4A3B;
    --pistil: #E2C585;
    --nuit: #0F1A14;
    --verre: rgba(15, 26, 20, 0.5);
    --verre-fort: rgba(15, 26, 20, 0.76);
    --trait: rgba(243, 245, 240, 0.22);
    --texte-doux: rgba(243, 245, 240, 0.74);
    --nom: "Great Vibes", cursive;
    --display: "Marcellus", "Times New Roman", serif;
    --ui: "Figtree", "Helvetica Neue", Arial, sans-serif;
  }
  html, body { height: 100%; }
  body {
    margin: 0; background: var(--nuit); color: var(--jasmin);
    font-family: var(--ui); font-weight: 400; font-size: 15px;
    overflow: hidden; -webkit-font-smoothing: antialiased;
    touch-action: none; user-select: none; -webkit-user-select: none;
  }
  canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
  canvas#scene.drag { cursor: grabbing; }

  /* ---------- barre du haut ---------- */
  .haut {
    position: fixed; top: 0; left: 0; right: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 18px;
    background: linear-gradient(to bottom, rgba(14,21,25,.55), rgba(14,21,25,0));
    pointer-events: none;
  }
  .haut > * { pointer-events: auto; }
  .marque { display: flex; align-items: center; gap: 12px; }
  .marque svg { width: 34px; height: 34px; flex: none; }
  .marque b { display: block; font-family: var(--nom); font-weight: 400; font-size: 34px; color: var(--pistil); line-height: 1; }
  .marque small { display: block; margin-top: 4px; font-size: 13px; color: var(--texte-doux); }
  .reserver {
    font: 600 15px/1 var(--ui);
    color: var(--nuit); background: var(--pistil); text-decoration: none; display: inline-flex; align-items: center; border: 0; border-radius: 999px;
    padding: 0 22px; height: 44px; cursor: pointer;
    box-shadow: 0 6px 24px rgba(0,0,0,.25); transition: transform .3s, background .3s;
  }
  .reserver:hover { background: var(--jasmin); transform: translateY(-1px); }

  /* ---------- flèches (pétales posés au sol) ---------- */
  #calque { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
  .fleche {
    position: absolute; left: 0; top: 0; pointer-events: auto;
    width: 72px; height: 72px; margin: -36px 0 0 -36px; padding: 0;
    background: none; border: 0; cursor: pointer; color: var(--jasmin);
    transition: opacity .5s;
  }
  .fleche .sol {
    position: absolute; inset: 0; border-radius: 50%;
    transform: perspective(240px) rotateX(52deg);
    background: radial-gradient(circle, rgba(14,21,25,.55) 0 55%, rgba(14,21,25,0) 72%);
    box-shadow: inset 0 0 0 1.5px rgba(250,248,242,.85);
    display: grid; place-items: center;
  }
  .fleche .sol::after {
    content: ""; position: absolute; inset: -10px; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(226,197,133,.7);
    animation: halo 2.6s ease-out infinite;
  }
  .fleche svg { width: 34px; height: 34px; transition: transform .35s; }
  .fleche.retour svg { transform: rotate(180deg); }
  .fleche:hover svg, .fleche:focus-visible svg { transform: translateY(-4px); }
  .fleche.retour:hover svg, .fleche.retour:focus-visible svg { transform: rotate(180deg) translateY(-4px); }
  .fleche:focus-visible { outline: none; }
  .fleche:focus-visible .sol { box-shadow: inset 0 0 0 2px var(--pistil); }
  .fleche .nom {
    position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-size: 14px; font-weight: 500;
    padding: 7px 12px; border-radius: 999px; background: var(--verre-fort);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    opacity: .78; transition: opacity .35s, transform .35s;
  }
  .fleche:hover .nom, .fleche:focus-visible .nom, body.tactile .fleche .nom { opacity: 1; transform: translateX(-50%) translateY(2px); }
  .fleche.bord .sol { transform: none; }
  @keyframes halo { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

  /* points d'information */
  .info {
    position: absolute; left: 0; top: 0; pointer-events: auto;
    width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
    background: none; border: 0; cursor: pointer; display: grid; place-items: center;
  }
  .info i {
    display: block; width: 12px; height: 12px; border-radius: 50%;
    background: var(--pistil); box-shadow: 0 0 0 5px rgba(226,197,133,.28), 0 2px 10px rgba(0,0,0,.4);
  }
  .info span {
    position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(4px);
    white-space: nowrap; font-family: var(--ui); font-size: 15px;
    padding: 8px 14px; border-radius: 12px; background: var(--verre-fort);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
  }
  .info:hover span, .info:focus-visible span, .info.ouvert span { opacity: 1; transform: translateX(-50%); }
  .info:focus-visible { outline: none; }
  .info:focus-visible i { box-shadow: 0 0 0 5px var(--pistil); }

  /* ---------- bas : nom de la pièce + parcours ---------- */
  .bas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding: 60px 22px calc(env(safe-area-inset-bottom, 0px) + 22px);
    background: linear-gradient(to top, rgba(14,21,25,.66), rgba(14,21,25,0));
    pointer-events: none;
  }
  .bas > * { pointer-events: auto; }
  .piece { max-width: 34rem; }
  .piece .surtitre { font-size: 14px; color: var(--pistil); font-variant-numeric: tabular-nums; }
  .piece h1 {
    margin: 8px 0 6px; font-family: var(--display); font-weight: 400;
    font-size: clamp(34px, 5.4vw, 60px); line-height: 1.02; text-wrap: balance;
  }
  .piece p { margin: 0; color: var(--texte-doux); font-size: 15px; }
  .piece .anim { transition: opacity .6s, transform .6s; }
  .piece.sortie .anim { opacity: 0; transform: translateY(8px); }

  .parcours {
    background: var(--verre); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--trait); border-radius: 18px; padding: 14px 16px 12px;
  }
  .parcours h2 { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--texte-doux); }
  .niveau { display: flex; align-items: center; gap: 10px; }
  .niveau + .niveau { margin-top: 8px; }
  .niveau em { width: 58px; font-style: normal; font-size: 13px; color: var(--texte-doux); }
  .etapes { display: flex; align-items: center; }
  .etape {
    position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
    display: grid; place-items: center;
  }
  .etape + .etape::before {
    content: ""; position: absolute; right: 100%; top: 50%; width: 8px; height: 1px; background: var(--trait);
  }
  .etapes { gap: 8px; }
  .etape i {
    display: block; width: 9px; height: 9px; border-radius: 50%;
    border: 1px solid rgba(250,248,242,.7); transition: all .35s;
  }
  .etape:hover i { background: rgba(250,248,242,.5); }
  .etape[aria-current="true"] i { width: 13px; height: 13px; background: var(--pistil); border-color: var(--pistil); box-shadow: 0 0 0 4px rgba(226,197,133,.25); }
  .etape:focus-visible { outline: 1px solid var(--pistil); outline-offset: 1px; border-radius: 50%; }
  .etape span {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-size: 13px; padding: 5px 9px; border-radius: 8px;
    background: var(--verre-fort); opacity: 0; transition: opacity .25s; pointer-events: none;
  }
  .etape:hover span, .etape:focus-visible span { opacity: 1; }

  /* ---------- ouverture : la fleur s'ouvre ---------- */
  #ouverture {
    position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
    background: radial-gradient(ellipse at 50% 40%, #1d3326 0%, var(--nuit) 72%);
    transition: opacity 1.1s ease, visibility 1.1s;
    padding-inline: 20px;
  }
  #ouverture.fini { opacity: 0; visibility: hidden; }
  .ouv { display: grid; justify-items: center; gap: 22px; text-align: center; max-width: 30rem; }
  .ouv .nom { font: 400 clamp(64px, 12vw, 104px)/1 var(--nom); color: var(--pistil); }
  .ouv .surtitre { font-size: 15px; color: var(--pistil); }
  .ouv h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 50px); line-height: 1; text-wrap: balance; }
  .ouv p { margin: 0; color: var(--texte-doux); line-height: 1.6; text-wrap: pretty; }
  .ouv button {
    margin-top: 6px; font: 600 16px/1 var(--ui);
    color: var(--jasmin); background: transparent; border: 1px solid rgba(250,248,242,.6);
    border-radius: 999px; padding: 16px 28px; min-height: 48px; cursor: pointer; transition: all .35s;
  }
  .ouv button:hover:not(:disabled), .ouv button:focus-visible { background: var(--jasmin); color: var(--nuit); outline: none; }
  .ouv button:disabled { opacity: .45; cursor: progress; }
  .ouv .note { font-size: 13px; color: rgba(243,245,240,.55); }

  .marque .retour { display: inline-block; margin-top: 6px; font-size: 14px; color: var(--pistil); text-decoration: none; }
  .marque .retour:hover { text-decoration: underline; }

  @media (max-width: 640px) {
    .haut { padding-inline: 16px; }
    .marque small { display: none; }
    .reserver { padding: 12px 16px; }
    .bas { padding-inline: 16px; gap: 14px; }
    .parcours { padding: 10px 12px; }
    .parcours h2 { display: none; }
    .piece p { font-size: 14px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .fleche .sol::after { animation: none; }
  }

/* Étiquettes des flèches proches d'un bord d'écran */
.fleche.a-gauche .nom, .info.a-gauche span { left: 0; transform: none; }
.fleche.a-droite .nom, .info.a-droite span { left: auto; right: 0; transform: none; }
.fleche.a-gauche:hover .nom, .fleche.a-droite:hover .nom, body.tactile .fleche.a-gauche .nom, body.tactile .fleche.a-droite .nom { transform: translateY(2px); }
