/* « Teste Caca Express » (hub/demo-caca.js) et le nouvel ordre de l'accueil (16 nov. 2026, Hugues).
   La boîte reprend .dm (halo à la couleur du jeu, pouls doux jusqu'au premier toucher, home.css) en rose Caca Express. */

/* ---------- l'ordre (fixé dans hub/hub.js) : Teste Size Guesser, Coupe en deux, Size Guesser, Teste Caca Express, Éducation, Et aussi, podium ---------- */
.home #sections > .shelf[id]{ order:0 !important; }

/* ---------- la boîte ---------- */
.dm.cx{ --c:#FF6FA3; }
.cx__stage{ position:relative; z-index:1; height:clamp(380px, 40vw, 560px); border-radius:18px; overflow:hidden;
  background:radial-gradient(55% 45% at 50% 100%, rgba(255,111,163,.16), transparent 70%), radial-gradient(50% 50% at 50% 30%, rgba(167,139,250,.1), transparent 70%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px, #08080D; }
.cx__svg, .cx__svg .pv-in{ position:absolute; inset:0; }
.cx__svg .pv-in{ opacity:1; }
.cx__svg .dgn{ position:absolute; inset:3% 0 2%; width:100%; height:95%; overflow:visible; }
.cx .dgn path, .cx .dgn ellipse{ stroke-linecap:round; stroke-linejoin:round; }
.cx .dgn > path:not(.dgn-sil){ fill:none; }
.cx .dgn-sil{ fill:rgba(255,255,255,.03); stroke:rgba(255,255,255,.14); stroke-width:1.5; }
.cx .dgn-glow{ opacity:.16; } .cx .dgn-body{ opacity:.55; } .cx .dgn-hi{ opacity:.38; }
.cx .dgn-liver{ filter:drop-shadow(0 0 6px rgba(232,102,77,.5)); }
.cx-bite image, .cx-poop{ filter:drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.cx-poop, .cx-ring{ transform-box:fill-box; transform-origin:50% 100%; }
.cx-ring{ transform-origin:50% 50%; }
.cx-mouth{ transform-box:fill-box; transform-origin:50% 50%; transition:fill-opacity .2s ease, stroke-width .2s ease; }
.cx.is-drag .cx-mouth, .demo--caca.is-drag .cx-mouth{ animation:cx-mouth .9s ease-in-out infinite; }
.demo--caca.is-over .cx-mouth{ fill-opacity:.6; stroke-width:4; }
@keyframes cx-mouth{ 50%{ transform:scale(1.25); } }

/* le côté : la question, le verdict, les trois aliments, puis « jouer » et « rejouer » */
.cx__side{ position:relative; z-index:1; display:flex; flex-direction:column; gap:18px; min-width:0; }
.cx__q{ margin:0; font-size:20px; color:rgba(245,242,236,.7); }
.cx__q b{ display:block; margin-top:6px; font-size:clamp(36px, 4.4vw, 54px); line-height:1.02; font-weight:700; letter-spacing:-.04em; color:#F5F2EC; }
.cx__r{ min-height:72px; margin:0; color:rgba(245,242,236,.82); font-size:16px; line-height:1.45; text-wrap:pretty; }
.cx__hint{ color:rgba(245,242,236,.6); }
.cx__type{ display:inline-block; margin-bottom:6px; padding:4px 11px; border-radius:99px; font-size:13px; font-weight:650; color:#0A0A0A; background:var(--fc); }
.cx__r span{ display:block; }
.cx__foods{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
.cx__foods[hidden], .cx__act[hidden]{ display:none; }
.cx__food{ --fc:#fff; position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; min-width:0; padding:12px 6px 10px; border:0; border-radius:20px; cursor:grab;
  background:radial-gradient(70% 60% at 50% 38%, color-mix(in srgb, var(--fc) 22%, transparent), transparent 75%), rgba(255,255,255,.04);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.09); color:#F5F2EC; font:600 14px/1.2 Geist, ui-sans-serif, system-ui, sans-serif;
  touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
  transition:transform .16s cubic-bezier(.23,1,.32,1), box-shadow .2s ease, opacity .2s ease; }
.cx__food img{ width:min(100%, 96px); height:auto; aspect-ratio:1; pointer-events:none; filter:drop-shadow(0 8px 12px rgba(0,0,0,.5)); }
.cx__food:active{ transform:scale(.96); }
.cx__food:focus-visible{ outline:2px solid #F5F2EC; outline-offset:3px; }
.cx__food:disabled{ cursor:default; opacity:.4; }
.cx__food.is-picked{ opacity:1; box-shadow:inset 0 0 0 2px var(--fc); }
.cx__food.is-lifted img{ opacity:.25; }
.cx__food.is-tried::after{ content:""; position:absolute; top:8px; right:8px; width:9px; height:9px; border-radius:50%; background:var(--fc); box-shadow:0 0 10px var(--fc); }
@media (hover:hover) and (pointer:fine){
  .cx__food:not(:disabled):hover{ transform:translateY(-3px); box-shadow:inset 0 0 0 1.5px color-mix(in srgb, var(--fc) 70%, transparent), 0 14px 30px -14px color-mix(in srgb, var(--fc) 80%, transparent); }
}
/* tant qu'on n'a pas touché : les aliments se dandinent l'un après l'autre */
.demo--caca:not(.is-touched) .cx__food img{ animation:cx-bob 2.4s cubic-bezier(.45,0,.55,1) infinite; }
.demo--caca:not(.is-touched) .cx__food:nth-child(2) img{ animation-delay:.2s; }
.demo--caca:not(.is-touched) .cx__food:nth-child(3) img{ animation-delay:.4s; }
@keyframes cx-bob{ 0%, 60%, 100%{ transform:none; } 20%{ transform:translateY(-6px) scale(1.04, .97); } 40%{ transform:translateY(0) scale(.98, 1.02); } }
.cx-ghost{ position:fixed; z-index:95; pointer-events:none; filter:drop-shadow(0 16px 20px rgba(0,0,0,.55)); will-change:transform; }

.cx__act{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.cx__go{ height:50px; padding:0 26px; font-size:16px; text-decoration:none; }
.cx__again{ height:50px; padding:0 22px; border:0; border-radius:999px; cursor:pointer; background:rgba(255,255,255,.08); color:#F5F2EC;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.16); font:600 16px/1 Geist, ui-sans-serif, system-ui, sans-serif; transition:transform .16s cubic-bezier(.23,1,.32,1); }
.cx__again:active, .cx__go:active{ transform:scale(.97); }
.cx__again:focus-visible{ outline:2px solid #F5F2EC; outline-offset:3px; }

@media (min-width:900px){ .cx__stage{ height:clamp(460px, 42vw, 580px); } }
@media (prefers-reduced-motion:reduce){
  .demo--caca .cx__food img, .demo--caca.is-drag .cx-mouth{ animation:none !important; }
  .cx__food, .cx__again{ transition:none; }
}

/* ---------- téléphone : scène + aliments (ou « jouer ») dans un écran, au-dessus de la barre d'onglets ---------- */
@media (max-width:700px){
  .dm.cx{ position:relative; gap:10px; }
  .cx__stage{ height:clamp(230px, calc(100svh - 350px), 520px); }
  .cx__q{ display:none; }
  .cx__side{ position:static; gap:0; }
  .cx__r{ position:absolute; z-index:3; left:16px; right:16px; top:16px; min-height:0; font-size:14px; line-height:1.35; pointer-events:none; }
  .demo--caca.is-done .cx__r{ padding:10px 12px; border-radius:14px; background:rgba(10,10,14,.82); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.1); }
  .cx__type{ font-size:12px; margin-bottom:5px; }
  .cx__foods{ gap:8px; }
  .cx__food{ padding:8px 4px 8px; border-radius:18px; font-size:13px; }
  .cx__food img{ width:min(100%, 68px); }
  .cx__act{ display:grid; grid-template-columns:1fr auto; gap:8px; }
  .cx__act[hidden]{ display:none; }
  .cx__go{ width:100%; height:52px; justify-content:center; font-size:16px; }
  .cx__again{ height:52px; padding:0 18px; }
}
