/* ============================================================
   Efectos: modo baile, pétalos, bigote que cruza, estela del cursor
   ============================================================ */

/* ------- Modo "Bailar": la interfaz se mueve al compás (paso alternado por audio.js / fx-dance.js) ------- */
body.is-dancing .room__title,
body.is-dancing .subhead,
body.is-dancing .hero__word,
body.is-dancing .post,
body.is-dancing .lesson,
body.is-dancing .staff__card,
body.is-dancing .ritual,
body.is-dancing .formats li,
body.is-dancing .swatch,
body.is-dancing .netbtn,
body.is-dancing .btn { transition: transform .22s var(--ease-groove); }
body.is-dancing[data-step="0"] .room__title, body.is-dancing[data-step="0"] .post:nth-child(odd), body.is-dancing[data-step="0"] .lesson:nth-child(odd), body.is-dancing[data-step="0"] .ritual:nth-child(odd), body.is-dancing[data-step="0"] .staff__card:nth-child(odd), body.is-dancing[data-step="0"] .formats li:nth-child(odd), body.is-dancing[data-step="0"] .swatch { transform: rotate(-2.5deg) translateY(-6px); }
body.is-dancing[data-step="1"] .room__title, body.is-dancing[data-step="1"] .post:nth-child(even), body.is-dancing[data-step="1"] .lesson:nth-child(even), body.is-dancing[data-step="1"] .ritual:nth-child(even), body.is-dancing[data-step="1"] .staff__card:nth-child(even), body.is-dancing[data-step="1"] .formats li:nth-child(even) { transform: rotate(2.5deg) translateY(4px); }
body.is-dancing[data-step="2"] .room__title, body.is-dancing[data-step="2"] .subhead, body.is-dancing[data-step="2"] .post, body.is-dancing[data-step="2"] .btn { transform: translateX(10px) skewX(-4deg); }
body.is-dancing[data-step="3"] .room__title, body.is-dancing[data-step="3"] .subhead, body.is-dancing[data-step="3"] .post, body.is-dancing[data-step="3"] .netbtn { transform: translateX(-10px) skewX(4deg); }
body.is-dancing[data-step="0"] .hero__word--a { transform: translateY(-10px) rotate(-3deg); }
body.is-dancing[data-step="1"] .hero__word--b { transform: translateY(-10px) rotate(3deg); }
body.is-dancing[data-step="2"] .hero__word { transform: scale(1.04); }
body.is-dancing .hero__robert { animation: groove .46s ease-in-out infinite alternate; transform-origin: 50% 85%; }
body.is-dancing .topbar__sil { animation: groove .46s ease-in-out infinite alternate; }

/* Robert entra bailando desde una esquina */
.dancer {
  position: fixed; z-index: 110; right: 2vw; bottom: calc(var(--player-h) + 18px); width: min(22vw, 190px); pointer-events: none;
  transform-origin: 50% 90%; animation: dancer-in .8s var(--ease-groove) both, groove .46s .8s ease-in-out infinite alternate;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.6));
}
.dancer.is-out { animation: dancer-out .6s ease-in both; }
@keyframes dancer-in { from { transform: translateY(120%) rotate(10deg); } }
@keyframes dancer-out { to { transform: translateY(120%); } }
@media (max-width: 640px) { .dancer { width: 28vw; right: 0; } }

/* ------- Capa de efectos: pétalos de rosa mosqueta, bigote volador ------- */
.fx-layer { position: fixed; inset: 0; z-index: 140; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -40px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0485c, var(--rojo) 55%, #6e1020);
  animation: petal-fall var(--d, 4s) var(--delay, 0s) cubic-bezier(.3,.1,.6,1) forwards;
}
.petal.is-gold { background: radial-gradient(circle at 35% 30%, #f6e2b0, var(--oro) 60%, var(--oro-viejo)); border-radius: 2px; width: 8px; height: 16px; }
@keyframes petal-fall {
  to { transform: translate(var(--x, 0), 110vh) rotate(var(--r, 360deg)); opacity: .7; }
}
.flying-moustache { position: absolute; top: 40%; left: 0; width: 120vw; height: 60px; color: var(--negro); filter: drop-shadow(0 0 2px var(--oro)) drop-shadow(0 10px 14px rgba(0,0,0,.5)); animation: fly 2.6s cubic-bezier(.5,0,.5,1) forwards; }
@keyframes fly { from { transform: translateX(-125vw); } to { transform: translateX(105vw); } }

/* ------- Estela dorada del cursor (solo punteros finos) ------- */
.cursor-trail { position: fixed; left: 0; top: 0; z-index: 260; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none; border: 1px solid rgba(230,204,147,.7); mix-blend-mode: screen; transition: width .25s, height .25s, margin .25s, opacity .3s; opacity: 0; }
.cursor-trail.is-on { opacity: 1; }
.cursor-trail.is-link { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(197,161,94,.12); }
@media (hover: none), (pointer: coarse) { .cursor-trail { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .dancer, .petal, .flying-moustache, .cursor-trail { display: none !important; }
  body.is-dancing * { transform: none !important; animation: none !important; }
}
