/* ClicksLab — projets d'inventeurs vivants : scène « Ton invention en vrai » + écran de lancement. */

/* ================= Scène en direct ================= */
.pv-scene {
  position: relative; flex: none; border-radius: 20px; padding: 3px; isolation: isolate;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 14px 34px -16px var(--c1);
  animation: pvRise .6s cubic-bezier(.2, 1.3, .4, 1) backwards;
}
.pv-scene.live { animation: pvRise .6s cubic-bezier(.2, 1.3, .4, 1) backwards, pvLive 2s ease-in-out infinite; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 7px; color: #fff; }
.pv-ttl { font: 600 1rem "Fredoka", sans-serif; text-shadow: 0 1px 6px rgba(0, 0, 0, .2); }
.pv-live { padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: .74rem; background: rgba(255, 255, 255, .25); border: 1px solid rgba(255, 255, 255, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pv-scene.live .pv-live { background: #fff; color: #12b886; animation: pvBlink 1.2s ease-in-out infinite; }
.pv-view { position: relative; border-radius: 17px; overflow: hidden; background: #0d1030; }
.pv-view svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.pv-view text { font-family: "Nunito", sans-serif; }
.pv-emo { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif !important; }
.pv-hud {
  position: absolute; right: 8px; top: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; border-radius: 14px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #23264a; font-weight: 800; font-size: .8rem;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .4);
}
.pv-val { flex: none; padding: 3px 10px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); font-variant-numeric: tabular-nums; }
.pv-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pvRise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pvLive { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 30%, transparent), 0 14px 34px -14px var(--c1); } }
@keyframes pvBlink { 50% { opacity: .65; } }
@keyframes pvPop { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.9); } }
@keyframes pvBob { 50% { transform: translateY(-3px); } }
.pv-waves path, .pv-bip, .pv-note, .pv-face, .pv-halo, .pv-sun circle, .pv-thirst { transform-box: fill-box; }

/* Canne */
.pv-waves path { fill: none; stroke: #12b886; stroke-width: 3; stroke-linecap: round; transform-origin: 0 50%; opacity: 0; }
.pv-scene.live .pv-waves path { animation: pvWave 1.4s ease-out infinite; }
.pv-scene.live .pv-waves path:nth-child(2) { animation-delay: .45s; }
.pv-scene.live .pv-waves path:nth-child(3) { animation-delay: .9s; }
[data-zone="mid"] .pv-waves path { stroke: #f59f00; }
[data-zone="near"] .pv-waves path { stroke: #f03e3e; animation-duration: .7s !important; }
.pv-waves.ping path { stroke-width: 4.5; }
@keyframes pvWave { 0% { opacity: .95; transform: scale(.6); } 100% { opacity: 0; transform: scale(4.2); } }
.pv-obst { transition: transform .12s linear; }
.pv-bip { opacity: 0; transform-origin: 50% 100%; }
.pv-bip.pop { animation: pvPop .5s ease-out; }
[data-zone="near"] .pv-bip text { fill: #f03e3e; }
.pv-scene.live .pv-cane { animation: pvBob 1.8s ease-in-out infinite; transform-origin: 50% 0; }

/* Poubelle */
.pv-lid { transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.pv-hand { transition: transform .12s linear; }
.pv-beam { opacity: .35; }
.pv-scene.live .pv-beam { opacity: .9; animation: pvDash .6s linear infinite; }
@keyframes pvDash { to { stroke-dashoffset: -18; } }
.pv-paper { opacity: 0; }
.pv-paper.drop { animation: pvDrop .9s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes pvDrop {
  0% { opacity: 1; transform: translate(calc(160px + var(--px)), 96px) rotate(0); }
  45% { opacity: 1; transform: translate(170px, 40px) rotate(200deg); }
  100% { opacity: 0; transform: translate(160px, 120px) rotate(360deg) scale(.6); }
}

/* Simon */
.pv-pad { opacity: .3; transition: opacity .12s, filter .12s; }
.pv-pad.on { opacity: 1; filter: drop-shadow(0 0 10px currentColor) brightness(1.25); }
.pv-pad[data-id="sr"] { color: #ff4d4f; } .pv-pad[data-id="sg"] { color: #40c057; } .pv-pad[data-id="sb"] { color: #4dabf7; } .pv-pad[data-id="sy"] { color: #fcc419; }
.pv-note { transform-origin: 50% 50%; }
.pv-note.pop { animation: pvNote .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pvNote { from { transform: scale(.3); opacity: 0; } }
.pv-scene.live .pv-stars circle { animation: pvBlink 1.6s ease-in-out infinite; }
.pv-stars circle:nth-child(2n) { animation-delay: .8s !important; }

/* Jardin */
.pv-plant { transform-origin: 160px 128px; transform-box: view-box; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.pv-drops path { opacity: 0; }
.pump-on .pv-drops path { animation: pvRain .7s linear infinite; }
.pump-on .pv-drops path:nth-child(2) { animation-delay: .23s; }
.pump-on .pv-drops path:nth-child(3) { animation-delay: .46s; }
@keyframes pvRain { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(50px); } }
.pump-on .pv-pump { animation: pvBlink .4s ease-in-out infinite; }
.pv-thirst { opacity: 0; transition: opacity .3s; }
.dry .pv-thirst { opacity: 1; animation: pvBob 1.2s ease-in-out infinite; }
.pump-on .pv-thirst { opacity: 0; }
.pv-soil { transition: fill .4s; }

/* Lampe des émotions */
.pv-lamp { color: #6c7096; transition: color .35s; }
.pv-halo { opacity: 0; transition: opacity .35s; transform-origin: 50% 50%; }
.pv-halo { filter: blur(22px); }
.lamp-on .pv-halo { opacity: .7; animation: pvBreath 2.6s ease-in-out infinite; }
@keyframes pvBreath { 50% { transform: scale(1.12); opacity: .75; } }
.pv-face { transform-origin: 50% 50%; }
.pv-face.pop { animation: pvNote .5s cubic-bezier(.3, 1.6, .5, 1); }

/* Tournesol */
.pv-panel { transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.pv-sun circle:first-child { animation: pvBreath 3s ease-in-out infinite; transform-origin: 50% 50%; }
.pv-ray { transition: opacity .2s; }

/* ================= Écran de lancement ================= */
.pv-intro {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(70% 60% at 20% 15%, color-mix(in srgb, var(--c1) 70%, transparent), transparent 70%),
    radial-gradient(60% 60% at 85% 90%, color-mix(in srgb, var(--c2) 60%, transparent), transparent 70%), rgba(12, 14, 40, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: pvFade .35s ease;
}
.pv-intro.bye { animation: pvOut .45s ease forwards; }
.pv-intro.bye .pv-card { animation: pvZoomOut .45s ease forwards; }
@keyframes pvFade { from { opacity: 0; } }
@keyframes pvOut { to { opacity: 0; } }
@keyframes pvZoomOut { to { transform: scale(1.15); opacity: 0; } }
.pv-fx span { position: absolute; left: var(--x); bottom: -40px; font-size: calc(1.6rem * var(--s)); opacity: .55; animation: pvUp var(--d) linear infinite; animation-delay: var(--w); }
@keyframes pvUp { to { transform: translateY(-115vh) rotate(360deg); } }

.pv-card {
  position: relative; width: min(500px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; text-align: center; color: #fff;
  padding: 26px 22px 24px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, .25);
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: pvCardIn .7s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
@keyframes pvCardIn { from { opacity: 0; transform: translateY(40px) scale(.85); } }
.pv-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 1rem; background: rgba(255, 255, 255, .15); transition: background .2s, transform .25s; }
.pv-x:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }
.pv-orb { position: relative; width: 132px; height: 132px; margin: 0 auto 12px; display: grid; place-items: center; }
.pv-orb::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--c2) 45%, var(--c1)); box-shadow: 0 0 50px var(--c1), 0 0 0 10px rgba(255, 255, 255, .08); animation: pvBreath 2.4s ease-in-out infinite; }
.pv-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent, #fff, transparent 35%, var(--c2), transparent 70%); -webkit-mask: radial-gradient(circle, transparent 60px, #000 61px); mask: radial-gradient(circle, transparent 60px, #000 61px); animation: pvSpin 3s linear infinite; }
@keyframes pvSpin { to { transform: rotate(360deg); } }
.pv-big { position: relative; font-size: 3.9rem; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35)); animation: pvBounce 1s cubic-bezier(.3, 1.8, .5, 1) .15s backwards, pjFloat 3.5s ease-in-out 1.2s infinite; }
@keyframes pvBounce { from { transform: scale(0) rotate(-40deg); } }
.pv-kick { display: inline-block; padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: .78rem; letter-spacing: .03em; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); animation: pvCardIn .6s .2s backwards; }
.pv-card h2 {
  margin: 10px 0 6px; font: 700 clamp(1.7rem, 6vw, 2.3rem)/1.1 "Fredoka", sans-serif;
  background: linear-gradient(90deg, #fff, var(--c2), #fff); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pvCardIn .6s .28s backwards, pvShine 3s linear 1s infinite;
}
@keyframes pvShine { to { background-position: -200% 0; } }
.pv-tag { margin: 0 auto 14px; max-width: 26rem; font-weight: 700; opacity: .92; animation: pvCardIn .6s .36s backwards; }
.pv-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pv-steps li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 99px; font-weight: 800; font-size: .82rem; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); animation: pvCardIn .5s cubic-bezier(.2, 1.5, .4, 1) backwards; animation-delay: calc(.45s + var(--k) * .08s); }
.pv-steps b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: .75rem; color: var(--c1); background: #fff; }
.pv-go {
  position: relative; border: 0; cursor: pointer; padding: 15px 34px; border-radius: 99px; font: 700 1.2rem "Fredoka", sans-serif; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 14px 30px -10px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .4);
  animation: pvCardIn .6s .7s backwards, pvGo 1.8s ease-in-out 1.4s infinite; transition: transform .2s;
}
.pv-go:hover { transform: translateY(-3px) scale(1.04); }
.pv-go:active { transform: scale(.96); }
.pv-go:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes pvGo { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .12), 0 14px 30px -10px var(--c1); } }
.pv-conf { position: fixed; z-index: 1001; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; animation: pvConf 1.2s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes pvConf { to { transform: translate(var(--tx), calc(var(--ty) + 160px)) rotate(var(--r)); opacity: 0; } }


/* ===== Projets « à construire en vrai » (scène sur la mission d'entraînement) ===== */
.pv-train { margin: -6px auto 14px; max-width: 26rem; padding: 6px 12px; border-radius: 12px; font-size: .86rem; font-weight: 700; background: rgba(255, 255, 255, .12); animation: pvCardIn .6s .4s backwards; }
.pv-fing, .pv-bubble, .pv-wx, .pv-bignote, .pv-trap, .pv-cat, .pv-heart, .pv-smoke circle, .pv-banner { transform-box: fill-box; }
/* Gant */
.pv-fing { transform-origin: 50% 100%; transition: transform .15s ease-out; }
.pv-bubble { opacity: 0; transform-origin: 50% 100%; }
.pv-bubble.pop { animation: pvPop 1.6s ease-out; }
/* Météo */
.pv-wx { transform-origin: 50% 70%; }
.pv-wx.pop { animation: pvNote .5s cubic-bezier(.3, 1.6, .5, 1); }
.pv-merc { transition: y .3s, height .3s; }
.pv-alert { opacity: .2; }
.alert-on .pv-alert { opacity: 1; animation: pvBlink .5s ease-in-out infinite; filter: drop-shadow(0 0 6px #fa5252); }
.pv-tint { transition: opacity .4s; }
/* Harpe */
.pv-beam7 line { opacity: .35; }
.pv-beam7 .pv-h { opacity: 0; }
.pv-beam7.cut line { animation: pvCut .7s ease-out; }
.pv-beam7.cut .pv-h { animation: pvHand .7s ease-out; }
.pv-beam7.hold line { opacity: .1; }
.pv-beam7.hold .pv-h { opacity: 1; }
.three .pv-beam7:nth-of-type(2), .three .pv-beam7:nth-of-type(4), .three .pv-beam7:nth-of-type(6), .three .pv-beam7:nth-of-type(7) { display: none; } /* harpe jouable : 3 rayons C, E, G */
@keyframes pvCut { 0% { opacity: 1; stroke-width: 9; filter: drop-shadow(0 0 8px currentColor); } 100% { opacity: .35; } }
@keyframes pvHand { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.pv-bignote { transform-origin: 50% 50%; }
.pv-bignote.pop { animation: pvNote .5s cubic-bezier(.3, 1.6, .5, 1); }
/* Croquettes */
.pv-trap { transform-origin: 0 50%; }
.pv-trap.open { animation: pvTrap 1.2s ease-in-out; }
@keyframes pvTrap { 15%, 70% { transform: rotate(70deg); } }
.pv-kib { opacity: 0; }
.pv-kib.drop { animation: pvKib 1.1s ease-in .15s; }
@keyframes pvKib { 0% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; transform: translateY(40px); } 100% { opacity: 0; transform: translateY(42px); } }
.pv-cat { transform-origin: 50% 100%; }
.pv-cat.pop { animation: pvNote .6s cubic-bezier(.3, 1.6, .5, 1); }
/* Forêt */
.pv-smoke circle { transform-origin: 50% 50%; animation: pvSmoke 3s ease-in-out infinite; }
.pv-smoke circle:nth-child(2) { animation-delay: -1s; } .pv-smoke circle:nth-child(3) { animation-delay: -2s; }
@keyframes pvSmoke { 50% { transform: translate(6px, -4px) scale(1.12); } }
.pv-siren { opacity: .3; }
.alarm-on .pv-siren { opacity: 1; animation: pvBlink .35s ease-in-out infinite; filter: drop-shadow(0 0 8px #fa5252); }
.pv-banner { opacity: 0; transform-origin: 50% 50%; transition: opacity .2s; }
.alarm-on .pv-banner { opacity: 1; animation: pvBob .6s ease-in-out infinite; }
/* Cardio */
.pv-ecg { stroke-dasharray: 1000; stroke-dashoffset: 0; opacity: .5; }
.pv-scene.live .pv-ecg { opacity: 1; animation: pvEcg 2.4s linear infinite; }
@keyframes pvEcg { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.pv-heart { transform-origin: 50% 50%; }
.pv-heart.beat { animation: pvBeat .45s ease-out; }
@keyframes pvBeat { 30% { transform: scale(1.25); filter: drop-shadow(0 0 12px #fa5252); } }
@media (max-width: 640px) {
  .pv-card { padding: 22px 16px 20px; border-radius: 26px; }
  .pv-orb { width: 110px; height: 110px; }
  .pv-ring { -webkit-mask: radial-gradient(circle, transparent 49px, #000 50px); mask: radial-gradient(circle, transparent 49px, #000 50px); }
  .pv-big { font-size: 3.2rem; }
  .pv-hud { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-scene, .pv-scene.live, .pv-scene *, .pv-intro, .pv-intro * { animation: none !important; transition: none !important; }
  .pv-fx { display: none; }
  .pv-bip, .pv-paper { display: none; }
}
