/* « À vous de nettoyer » : le petit jeu de la page d'accueil.
   Utilise les variables de couleur de la page (--ink, --lake, --mist, --line, --muted, --sun). */
.clean-demo{ padding:72px 0 24px; }
.clean-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:24px; flex-wrap:wrap; margin-bottom:22px; }
.clean-head h2{ font-family:'IBM Plex Sans', sans-serif; font-weight:600; letter-spacing:-.02em; font-size:clamp(30px, 4.4vw, 46px); line-height:1.05; margin:0; }
.clean-head p{ margin:8px 0 0; color:var(--muted); font-size:15px; max-width:440px; }
.clean-meter{ font-size:13px; color:var(--lake-deep); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.clean-meter .bar{ width:140px; height:6px; border-radius:6px; background:var(--mist); overflow:hidden; }
.clean-meter .bar span{ display:block; height:100%; width:0; background:var(--lake); transition:width .2s ease; }
.clean-timer{ font-family:'IBM Plex Mono', monospace; font-size:14px; background:var(--mist); border-radius:999px; padding:4px 10px; min-width:52px; text-align:center; }
.clean-timer::before{ content:"⏱ "; }
.clean-reset{ background:none; border:1px solid var(--line); border-radius:999px; padding:6px 12px; font-size:12px; color:var(--muted); cursor:pointer; font-family:inherit; }
.clean-reset:hover{ color:var(--lake); border-color:var(--lake); }

.clean-stage{ position:relative; border-radius:10px; overflow:hidden; aspect-ratio:16/9; max-height:520px; width:100%; background:var(--mist); touch-action:none; user-select:none; -webkit-user-select:none; }
.clean-stage.show-cursor{ cursor:none; }
.clean-stage.is-done{ cursor:auto; }
.clean-stage img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; }
.clean-stage canvas{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; transition:opacity .8s ease; }
.clean-stage canvas.multiply{ mix-blend-mode:multiply; }
.clean-stage.is-done canvas{ opacity:0; }

/* Curseur en forme d'outil (éponge, spray, aspirateur, raclette) */
.clean-cursor{ position:absolute; left:0; top:0; width:56px; height:56px; pointer-events:none; z-index:6; opacity:0; transition:opacity .15s ease; filter:drop-shadow(0 4px 6px rgba(16,36,46,.35)); }
.clean-cursor svg{ width:100%; height:100%; display:block; }
.clean-stage.show-cursor .clean-cursor{ opacity:1; }
.clean-stage.is-done .clean-cursor{ opacity:0; }
.clean-cursor.is-psst svg{ animation:psst .18s ease-out; }
@keyframes psst{ 0%{ transform:scale(1); } 40%{ transform:scale(.9) translate(2px, 2px); } 100%{ transform:scale(1); } }

/* Barre d'outils */
.clean-tools{ position:absolute; left:12px; top:12px; z-index:5; display:flex; gap:6px; padding:6px; border-radius:16px; background:rgba(16,36,46,.72); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); transition:opacity .3s ease; }
.clean-stage.is-done .clean-tools{ opacity:0; pointer-events:none; }
.clean-tool{ display:flex; flex-direction:column; align-items:center; gap:2px; width:66px; padding:6px 4px 5px; border:0; border-radius:11px; background:transparent; color:#E4EDEC; font:500 11px 'IBM Plex Sans', sans-serif; cursor:pointer; transition:background .15s ease, transform .15s ease; }
.clean-tool svg{ width:34px; height:34px; transition:transform .2s ease; }
.clean-tool:hover{ background:rgba(255,255,255,.12); }
.clean-tool:hover svg{ transform:rotate(-8deg) scale(1.06); }
.clean-tool.is-active{ background:#fff; color:var(--ink); box-shadow:0 4px 12px rgba(0,0,0,.25); }
.clean-tool:focus-visible{ outline:2px solid var(--sun); outline-offset:2px; }

/* Indice (« Ça résiste… un coup de spray ? ») */
.clean-hint{ position:absolute; left:50%; bottom:16px; z-index:5; transform:translate(-50%, 8px); opacity:0; pointer-events:none; max-width:calc(100% - 28px);
  background:#fff; color:var(--ink); font-size:14px; font-weight:500; padding:9px 16px; border-radius:999px; box-shadow:0 8px 24px rgba(16,36,46,.25); transition:opacity .25s ease, transform .25s ease; text-align:center; }
.clean-hint.is-on{ opacity:1; transform:translate(-50%, 0); }

/* Fin de partie */
.clean-done{
  position:absolute; left:50%; bottom:18px; z-index:5; transform:translate(-50%, 12px); opacity:0; pointer-events:none;
  background:rgba(16,36,46,.9); color:#fff; border-radius:18px; padding:12px 12px 12px 20px;
  display:flex; align-items:center; gap:16px; font-size:14px; transition:opacity .4s ease .4s, transform .4s ease .4s; max-width:calc(100% - 28px);
}
.clean-stage.is-done .clean-done{ opacity:1; transform:translate(-50%, 0); pointer-events:auto; }
.clean-done-text{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; }
.clean-done-text strong{ font-size:16px; }
.clean-done-text small{ color:#BFD3D1; font-size:12px; }
.clean-stars span{ color:rgba(255,255,255,.25); font-size:18px; letter-spacing:1px; }
.clean-stars span.on{ color:var(--sun); animation:star-in .5s ease backwards; }
.clean-stars span.on:nth-child(2){ animation-delay:.5s; } .clean-stars span.on:nth-child(3){ animation-delay:.65s; }
@keyframes star-in{ 0%{ transform:scale(0); } 70%{ transform:scale(1.35); } 100%{ transform:scale(1); } }
.clean-cta{
  display:inline-flex; align-items:center; gap:8px; background:var(--sun); color:var(--ink); text-decoration:none; white-space:nowrap;
  font-weight:600; font-size:13px; padding:10px 16px; border-radius:999px; transition:transform .15s ease, background .15s ease;
}
.clean-cta:hover, .clean-cta:focus-visible{ background:#E8B95A; transform:translateY(-2px); }

/* Étincelles et « Nickel ! » quand une tache disparaît */
.clean-sparkles{ position:absolute; inset:0; pointer-events:none; z-index:4; }
/* Animées par clean-demo.js (voir flash) */
.clean-star{ position:absolute; width:24px; height:24px; margin:-12px 0 0 -12px; }
.clean-star::before, .clean-star::after{ content:""; position:absolute; left:50%; top:50%; background:#fff; border-radius:2px; box-shadow:0 0 10px 3px rgba(255,255,255,.85); }
.clean-star::before{ width:2px; height:24px; margin:-12px 0 0 -1px; }
.clean-star::after{ width:24px; height:2px; margin:-1px 0 0 -12px; }
.clean-pop{ position:absolute; transform:translate(-50%, -90%); font:700 14px 'IBM Plex Sans', sans-serif; color:#fff; white-space:nowrap;
  background:var(--lake); padding:3px 10px; border-radius:999px; box-shadow:0 6px 16px rgba(16,36,46,.3); pointer-events:none; }

@media (max-width: 760px){
  .clean-stage{ aspect-ratio:4/3; }
  .clean-tools{ left:8px; top:8px; gap:4px; padding:4px; }
  .clean-tool{ width:50px; font-size:10px; }
  .clean-tool svg{ width:28px; height:28px; }
  .clean-done{ width:calc(100% - 24px); flex-direction:column; align-items:flex-start; gap:10px; bottom:10px; }
  .clean-hint{ font-size:13px; bottom:10px; }
}
@media (max-width: 480px){
  .clean-tool{ width:38px; padding:5px 3px; }
  .clean-tool span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }   /* nom gardé pour les lecteurs d'écran */
  .clean-tool svg{ width:26px; height:26px; }
  .clean-cursor{ width:44px; height:44px; }
}
