/* v3-phone : le grand telephone, 4 etapes (swing, speed, queue, turn), ~1 ecran de haut : on tape sur l'ecran pour passer a l'etape suivante (v3-phone.js).
   Derive de v2-phone.css (non modifie). Sans JS ou avec prefers-reduced-motion : le telephone (image de depart) et les notes en liste, rien ne bouge.
   Avec JS : .pt-on sur la section ; la scene (.pt-stage) fait 100 % de l'ecran, le telephone au milieu, la note de l'etape a cote (a ≤ 40 px du bord), les pastilles dessous. */

.phone-tour {
  --bz: 0px;             /* epaisseur du contour (0 : un simple ecran ; .framed sur la section : contour fin) */
  --rad: 28px;
  --ar: .5625;           /* largeur / hauteur de l'ecran (v3-phone.js la lit dans le json de la video) */
  --gap: 34px;           /* ecart telephone - notes (le texte colle au telephone : <= 40 px) */
  --ph: min(84vh, 780px);
  --pw: calc((var(--ph) - 2 * var(--bz)) * var(--ar) + 2 * var(--bz));
  --pt-ink: var(--ink, #2E2823); --pt-paper: var(--paper, #F3E9DC);
  position: relative; color: var(--pt-ink); font-family: var(--font, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif);
}
@supports (height: 100svh) { .phone-tour { --ph: min(84svh, 780px); } }
/* video de remplacement paysage : la largeur commande */
.phone-tour.pt-land { --pw: min(54vw, 640px); --ph: calc((var(--pw) - 2 * var(--bz)) / var(--ar) + 2 * var(--bz)); }
@media (max-width: 1000px) {
  .phone-tour { --gap: 0px; --ph: min(calc(100vh - 176px), calc((100vw - 32px - 2 * var(--bz)) / var(--ar) + 2 * var(--bz))); }
  @supports (height: 100svh) { .phone-tour { --ph: min(calc(100svh - 176px), calc((100vw - 32px - 2 * var(--bz)) / var(--ar) + 2 * var(--bz))); } }
  .phone-tour.pt-land { --pw: calc(100vw - 32px); --ph: calc((var(--pw) - 2 * var(--bz)) / var(--ar) + 2 * var(--bz)); }
}

.pt-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- l'ecran : un grand panneau 9:16, coins arrondis, ombre douce, fin liseré ; .framed sur la section = contour de telephone fin ---------- */
.pt-phone { position: relative; flex: none; width: var(--pw); height: var(--ph); padding: var(--bz); border-radius: var(--rad); background: transparent;
  box-shadow: 0 0 0 1px rgba(46, 40, 35, .14), 0 40px 80px -36px rgba(70, 40, 20, .5), 0 12px 28px -14px rgba(70, 40, 20, .32); }
.pt-screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--rad) - var(--bz)); overflow: hidden; isolation: isolate; background: #E9DFD2; }
.phone-tour.framed { --bz: 7px; --rad: 36px; }
.phone-tour.framed .pt-phone { background: #2E2823; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 40px 80px -36px rgba(70, 40, 20, .5), 0 12px 28px -14px rgba(70, 40, 20, .32); }
.pt-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; background: #E9DFD2; }
.pt-video[hidden] { display: none; }
.pt-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #EBE6DB; opacity: 0; visibility: hidden; transition: opacity .4s ease; }
.pt-frame.is-in { opacity: 1; visibility: visible; }
.pt-frame.is-off { display: none; }

/* l'ecran se tape (v3-phone.js) : un glissement vertical reste a la page */
.phone-tour.pt-on .pt-screen { cursor: pointer; touch-action: pan-y; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.phone-tour.pt-on .pt-screen.is-turn { cursor: auto; }
.pt-screen:focus-visible { outline: 3px solid var(--pt-ink); outline-offset: 5px; }
/* anneau a l'endroit du tap (le cercle de tap du jeu) */
.pt-rip { position: absolute; z-index: 3; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; border: 3px solid var(--pt-ink); background: rgba(255, 255, 255, .25); pointer-events: none; opacity: 0; animation: pt-rip .6s cubic-bezier(.2, .7, .3, 1); }
@keyframes pt-rip { 0% { opacity: .85; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.25); } }
/* indice : « Tap to continue », tant qu'on n'a pas tape */
.pt-hint { position: absolute; z-index: 3; left: 50%; bottom: 4.5%; translate: -50% 0; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 16px 0 9px; border-radius: 18px;
  background: rgba(46, 40, 35, .88); color: var(--pt-paper); font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: .005em; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .35s ease; box-shadow: 0 10px 22px -10px rgba(40, 20, 10, .6); }
.pt-hint.is-on { opacity: 1; transition-delay: 1.2s; }
.pt-hint i { position: relative; flex: none; width: 22px; height: 22px; }
.pt-hint i::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; animation: pt-pulse 1.9s ease-out infinite; }
.pt-hint i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: currentColor; }
@keyframes pt-pulse { 0% { transform: scale(.45); opacity: .95; } 70%, 100% { transform: scale(1.15); opacity: 0; } }

/* voile : le jeu piege la molette et le doigt, on ne l'ouvre qu'a la demande */
.pt-veil { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; margin: 0; padding: 0; border: 0; cursor: pointer;
  background: rgba(243, 233, 220, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: var(--pt-ink); font-family: inherit; font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; line-height: 1.1; letter-spacing: -.005em;
  visibility: hidden; opacity: 0; transition: opacity .3s ease, visibility 0s .3s; -webkit-tap-highlight-color: transparent; }
.pt-veil svg { width: 74px; height: 74px; flex: none; }
.pt-veil svg circle { fill: var(--pt-ink); }
.pt-veil svg path { fill: var(--pt-paper); }
.pt-veil:focus-visible { outline: 3px solid var(--pt-ink); outline-offset: -8px; }
.pt-screen.is-turn:not(.is-playing) .pt-veil { visibility: visible; opacity: 1; transition: opacity .3s ease .25s, visibility 0s; }
.pt-screen.is-turn:not(.is-playing) .pt-veil svg { animation: pt-beat 1.9s ease-in-out infinite; }
@keyframes pt-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.pt-veil:hover svg { animation-play-state: paused; transform: scale(1.1); }
/* croix : rend la main a la page */
.pt-x { position: absolute; z-index: 4; top: -12px; right: -10px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--pt-ink); color: var(--pt-paper); cursor: pointer;
  box-shadow: 0 0 0 3px var(--pt-paper), 0 8px 16px -6px rgba(70, 40, 20, .5); display: none; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.pt-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pt-x:focus-visible { outline: 2px solid var(--pt-ink); outline-offset: 5px; }
.pt-phone.is-playing .pt-x { display: flex; }
/* bouton lecture (mouvement reduit) */
.pt-pp { position: absolute; z-index: 2; left: 50%; bottom: 7%; translate: -50% 0; display: none; align-items: center; gap: 10px; height: 48px; padding: 0 22px 0 16px; border: 0; border-radius: 24px; background: var(--pt-ink); color: var(--pt-paper); font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 10px 22px -10px rgba(40, 20, 10, .6); }
.pt-pp svg { width: 20px; height: 20px; fill: currentColor; }
.pt-pp .ps { display: none; } .pt-pp.is-on .pl { display: none; } .pt-pp.is-on .ps { display: inline; }
.pt-pp:focus-visible { outline: 3px solid var(--pt-paper); outline-offset: 3px; }
.phone-tour.pt-red .pt-pp { display: inline-flex; }
.pt-screen.is-turn .pt-pp, .phone-tour.pt-red .pt-screen.is-playing .pt-pp { display: none; }

/* ---------- les notes : grandes, collees au telephone ---------- */
.pt-notes { list-style: none; margin: 0; padding: 0; }
.pt-note p { margin: 0; font-size: clamp(34px, 3.1vw, 46px); font-weight: 700; letter-spacing: -.015em; line-height: 1.06; text-wrap: balance; }
.pt-note mark { color: inherit; padding: 0 .08em; margin: 0 -.08em; background: linear-gradient(transparent 60%, rgba(232, 176, 74, .6) 60% 93%, transparent 93%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pt-note .pt-rgb { background: linear-gradient(90deg, #2E9E5B 0 33.4%, #2F6FDE 33.4% 66.7%, #D9533A 66.7% 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.pt-here { display: inline-flex; align-items: center; height: 50px; margin-top: 16px; padding: 0 24px; border: 0; border-radius: 10px; background: var(--pt-ink); color: var(--pt-paper); font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 4px 5px 0 rgba(160, 155, 140, .45); }
.pt-here:focus-visible { outline: 2px solid var(--pt-ink); outline-offset: 4px; }
/* « Replay the tour » : un petit lien sous « Your turn. » */
.pt-replay { display: block; margin: 10px 0 0; padding: 6px 0; border: 0; background: none; color: rgba(46, 40, 35, .72); font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(46, 40, 35, .35); text-underline-offset: 4px; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.pt-replay:hover { color: var(--pt-ink); text-decoration-color: var(--pt-ink); }
.pt-replay:focus-visible { outline: 2px solid var(--pt-ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- sans JS / mouvement reduit : le telephone et la liste ---------- */
.phone-tour:not(.pt-on) { display: grid; grid-template-columns: auto minmax(0, 460px); gap: 36px clamp(40px, 7vw, 96px); justify-content: center; align-items: center; max-width: 1120px; margin: 0 auto; padding: 100px 24px 60px; }
.phone-tour:not(.pt-on) .pt-stage { display: contents; }
.phone-tour:not(.pt-on) .pt-phone { position: relative; --gap: 0px; }
.phone-tour:not(.pt-on) .pt-notes { display: flex; flex-direction: column; gap: 30px; }
.phone-tour:not(.pt-on) .pt-arrows { display: none; }
@media (max-width: 1000px) {
  .phone-tour:not(.pt-on) { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 70px 16px 40px; }
  .phone-tour:not(.pt-on) .pt-notes { align-items: center; text-align: center; }
}

/* ---------- avec JS : la scene fait un ecran, la note de l'etape pope a cote du telephone, les pastilles dessous ---------- */
.phone-tour.pt-on .pt-stage { position: relative; height: 100vh; height: 100svh; min-height: 600px; display: flex; align-items: center; justify-content: center; }
.phone-tour.pt-on .pt-notes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.phone-tour.pt-on .pt-note { position: absolute; top: 50%; width: fit-content; max-width: min(460px, calc(50% - var(--pw) / 2 - var(--gap) - 18px)); margin: 0;
  opacity: 0; visibility: hidden; transform: translate(var(--tx, 0), 18px) scale(.9); transition: opacity .22s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1), visibility 0s .6s; will-change: transform, opacity; pointer-events: none; }
.phone-tour.pt-on .pt-note.is-right { left: calc(50% + var(--pw) / 2 + var(--gap)); --tx: -16px; transform-origin: 0 50%; }
.phone-tour.pt-on .pt-note.is-left { right: calc(50% + var(--pw) / 2 + var(--gap)); text-align: right; --tx: 16px; transform-origin: 100% 50%; }
.phone-tour.pt-on .pt-note.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .22s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1), visibility 0s; }
.phone-tour.pt-on .pt-note.is-past { opacity: 0; transform: translateY(-10px) scale(.97); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
.phone-tour.pt-on .pt-arrows { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.phone-tour.pt-on .pt-arrows path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.phone-tour.pt-on .pt-arrows .h { stroke: var(--pt-paper); stroke-width: 8; stroke-opacity: .9; }
.phone-tour.pt-on .pt-arrows .k { stroke: var(--pt-ink); stroke-width: 3; }
.phone-tour.pt-on .pt-arrows .ping { fill: none; stroke: var(--pt-ink); stroke-width: 2.4; transform-box: fill-box; transform-origin: center; }
/* pastilles de progression, cliquables */
.pt-dots { position: absolute; z-index: 4; left: 50%; top: calc(50% + var(--ph) / 2 + 12px); translate: -50% 0; display: flex; gap: 2px; }
.pt-dots button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pt-dots button::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: var(--pt-ink); opacity: .26; transition: width .3s ease, opacity .3s ease; }
.pt-dots button:hover::before { opacity: .5; }
.pt-dots button[aria-current="step"]::before { width: 26px; opacity: .85; }
.pt-dots button:focus-visible { outline: 2px solid var(--pt-ink); outline-offset: 1px; }

/* mobile : le telephone presque pleine largeur ; chaque note est un autocollant pose sur l'ecran a cote de l'element pointe (v3-phone.js), les pastilles et « Your turn. » sont sous le telephone */
@media (max-width: 1000px) {
  .phone-tour { --pt-top: max(14px, calc((100vh - var(--ph) - 150px) / 2)); }
  @supports (height: 100svh) { .phone-tour { --pt-top: max(14px, calc((100svh - var(--ph) - 150px) / 2)); } }
  .phone-tour.pt-on .pt-stage { align-items: flex-start; padding-top: var(--pt-top); }
  .pt-dots { top: calc(var(--pt-top) + var(--ph) + 8px); }
  .phone-tour.pt-on .pt-note, .phone-tour.pt-on .pt-note.is-left, .phone-tour.pt-on .pt-note.is-right { top: calc(var(--pt-top) + var(--ph) + 52px); left: 0; right: 0; margin: 0 auto; max-width: calc(100% - 40px); text-align: center; --tx: 0px; transform-origin: 50% 0; }
  .phone-tour.pt-on .pt-note.is-call { right: auto; margin: 0; width: fit-content; max-width: min(300px, calc(var(--pw) - 2 * var(--bz) - 28px)); padding: 9px 14px 11px; border-radius: 14px; text-align: left; --tx: 0px;
    background: #FFFDF9; box-shadow: 0 0 0 1px rgba(46, 40, 35, .09), 0 14px 26px -12px rgba(60, 35, 15, .55); rotate: -1.2deg; }
  .phone-tour.pt-on .pt-note.is-call:nth-child(even) { rotate: 1deg; }
  .phone-tour.pt-on .pt-note.is-call p { font-size: clamp(24px, 6.4vw, 27px); line-height: 1.08; }
  .pt-note p { font-size: clamp(26px, 6.8vw, 32px); }
  .pt-replay { margin: 4px auto 0; }
  @media (min-width: 600px) { .phone-tour.pt-on .pt-note.is-call { max-width: min(380px, calc(var(--pw) - 2 * var(--bz) - 40px)); padding: 12px 18px 14px; } .phone-tour.pt-on .pt-note.is-call p { font-size: 30px; } }
  .pt-x { top: -10px; right: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-veil svg, .pt-hint i::before { animation: none !important; }
  .pt-frame, .pt-hint, .pt-dots button::before { transition: none; }
}
/* Sortie : la dernière étape, « Your turn. », montre sur l'écran les deux boutons des magasins (voir .stores dans index.html) au lieu du jeu jouable */
.pt-store { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(242, 240, 234, .84);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
.pt-store.is-in { opacity: 1; visibility: visible; transition: opacity .35s ease .15s, visibility 0s; }
.pt-store .stores { flex-direction: column; gap: 14px; margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pt-store.is-in .st { animation: st-swing 1.1s cubic-bezier(.35, .6, .3, 1) both .2s; }
  .pt-store.is-in .st-ios { animation-delay: .4s; }
  .pt-store.is-in .st::after { animation: st-ring .55s ease-out both 1.25s; }
  .pt-store.is-in .st-ios::after { animation-delay: 1.45s; }
}
.phone-tour:not(.pt-on) .pt-store { display: none; }
