/*
 * Quizshow W3 Studio-Details: Studio-Crew (js/quizStage/themeAnim/quizshow/crew.js). Nur transform/opacity, Dauer wie CREW_MS
 * (Bühnenarbeiter 4 s, Kameramann 3 s, Ausblenden der Tasse 0,6 s). Figurhöhe 18vh.
 */
.pq-qs-crew {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.pq-qs-crew svg g[class] {
  transform-box: view-box;
  transform-origin: 0 0;
}
.pq-qs-crew__fig {
  display: block;
  height: 18vh;
  width: auto;
  overflow: visible;
}
.pq-qs-crew__act {
  position: absolute;
  bottom: 1.5vh;
  will-change: transform;
}
.pq-qs-crew--rtl .pq-qs-crew__flip,
.pq-qs-crew--right .pq-qs-crew__flip {
  transform: scaleX(-1);
}

/* ---------------------------------------------------------------------------------------------------------------------------- */
/* Bühnenarbeiter: anschleichen (0–45 %), bremsen, erschrecken (50–64 %), davonsprinten                                          */
/* ---------------------------------------------------------------------------------------------------------------------------- */
.pq-qs-crew__act--stagehand {
  left: 0;
  animation: pq-qs-crew-scurry 4s linear both;
}
.pq-qs-crew__act--stagehand.pq-qs-crew--rtl {
  animation-name: pq-qs-crew-scurry-rtl;
}
@keyframes pq-qs-crew-scurry {
  0% { transform: translateX(-110%); animation-timing-function: linear; }
  42% { transform: translateX(calc(40vw - 50%)); animation-timing-function: ease-out; }
  50% { transform: translateX(calc(44vw - 50%)); }
  64% { transform: translateX(calc(44vw - 50%)); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
  100% { transform: translateX(calc(100vw + 10%)); }
}
@keyframes pq-qs-crew-scurry-rtl {
  0% { transform: translateX(calc(100vw + 10%)); animation-timing-function: linear; }
  42% { transform: translateX(calc(60vw - 50%)); animation-timing-function: ease-out; }
  50% { transform: translateX(calc(56vw - 50%)); }
  64% { transform: translateX(calc(56vw - 50%)); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
  100% { transform: translateX(-110%); }
}
/* Trippelschritte (beim Sprint wirbeln die Beine weiter) */
.pq-qs-crew__act--stagehand .pq-qs-crew__bob {
  animation: pq-qs-crew-bob 0.3s ease-in-out infinite alternate;
}
@keyframes pq-qs-crew-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-0.7vh); }
}
.pq-qs-crew__act--stagehand .pq-qs-crew__leg--a {
  animation: pq-qs-crew-step 0.3s ease-in-out infinite alternate;
}
.pq-qs-crew__act--stagehand .pq-qs-crew__leg--b {
  animation: pq-qs-crew-step 0.3s ease-in-out -0.3s infinite alternate-reverse;
}
@keyframes pq-qs-crew-step {
  from { transform: rotate(-30deg); }
  to { transform: rotate(26deg); }
}
/* Schrecksprung */
.pq-qs-crew__act--stagehand .pq-qs-crew__fig {
  animation: pq-qs-crew-jump 4s linear both;
}
@keyframes pq-qs-crew-jump {
  0%, 49% { transform: translateY(0) rotate(0deg); }
  52% { transform: translateY(-5vh) rotate(-4deg); animation-timing-function: ease-in; }
  56% { transform: translateY(0) rotate(0deg); }
  58% { transform: translateY(-0.8vh); }
  60%, 100% { transform: translateY(0); }
}
.pq-qs-crew__act--stagehand .pq-qs-crew__face--side {
  animation: pq-qs-crew-side 4s step-end both;
}
.pq-qs-crew__act--stagehand .pq-qs-crew__face--front {
  animation: pq-qs-crew-front 4s step-end both;
}
@keyframes pq-qs-crew-side {
  0% { opacity: 1; }
  49% { opacity: 0; }
  64% { opacity: 1; }
}
@keyframes pq-qs-crew-front {
  0% { opacity: 0; }
  49% { opacity: 1; }
  64% { opacity: 0; }
}
.pq-qs-crew__act--stagehand .pq-qs-crew__alarm {
  animation: pq-qs-crew-alarm 4s linear both;
}
@keyframes pq-qs-crew-alarm {
  0%, 49% { transform: scale(0); opacity: 0; }
  52% { transform: scale(1.35) rotate(8deg); opacity: 1; }
  55% { transform: scale(1) rotate(-6deg); opacity: 1; }
  58% { transform: scale(1.1) rotate(4deg); opacity: 1; }
  62% { transform: scale(1) rotate(0deg); opacity: 1; }
  66%, 100% { transform: scale(0.4); opacity: 0; }
}
.pq-qs-crew__act--stagehand .pq-qs-crew__sweat {
  animation: pq-qs-crew-sweat 4s ease-out both;
}
@keyframes pq-qs-crew-sweat {
  0%, 51% { transform: translate(0, 0); opacity: 0; }
  53% { transform: translate(0, -4px); opacity: 1; }
  68% { transform: translate(0, 10px); opacity: 1; }
  74%, 100% { transform: translate(0, 18px); opacity: 0; }
}
.pq-qs-crew__dust {
  animation: pq-qs-crew-dust 0.6s ease-out infinite;
}
@keyframes pq-qs-crew-dust {
  from { transform: translate(0, 0) scale(0.6); opacity: 0.9; }
  to { transform: translate(14px, -10px) scale(1.4); opacity: 0; }
}
/* Leiter wippt auf der Schulter */
.pq-qs-crew--ladder .pq-qs-crew__prop {
  animation: pq-qs-crew-wobble 0.6s ease-in-out infinite alternate;
}
@keyframes pq-qs-crew-wobble {
  from { transform: translate(0, 0); }
  to { transform: translate(0, 3px); }
}

/* ---------------------------------------------------------------------------------------------------------------------------- */
/* Kameramann: rollt herein (0–18 %), wischt sich die Stirn oder schwenkt, rollt zurück                                          */
/* ---------------------------------------------------------------------------------------------------------------------------- */
.pq-qs-crew__act--cameraman {
  bottom: 1vh;
}
.pq-qs-crew__act--cameraman.pq-qs-crew--left {
  left: 0.5vw;
}
.pq-qs-crew__act--cameraman.pq-qs-crew--right {
  right: 0.5vw;
}
.pq-qs-crew__roll {
  animation: pq-qs-crew-roll 3s both;
}
@keyframes pq-qs-crew-roll {
  0% { transform: translateX(-115%); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1.15); }
  18% { transform: translateX(0); }
  84% { transform: translateX(0); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  100% { transform: translateX(-115%); }
}
/* Taschentuch */
.pq-qs-crew--wipe .pq-qs-crew__wipe {
  animation: pq-qs-crew-wipe 3s ease-in-out both;
}
@keyframes pq-qs-crew-wipe {
  0%, 20% { transform: translate(0, 0) rotate(0deg); }
  30% { transform: translate(6px, -28px) rotate(-180deg); }
  37% { transform: translate(2px, -28px) rotate(-166deg); }
  44% { transform: translate(10px, -30px) rotate(-194deg); }
  51% { transform: translate(2px, -28px) rotate(-166deg); }
  58% { transform: translate(10px, -30px) rotate(-194deg); }
  65% { transform: translate(6px, -28px) rotate(-180deg); }
  76%, 100% { transform: translate(0, 0) rotate(0deg); }
}
.pq-qs-crew__face--puh,
.pq-qs-crew__act--cameraman .pq-qs-crew__sweat {
  opacity: 0;
}
.pq-qs-crew--wipe .pq-qs-crew__face--focus {
  animation: pq-qs-crew-focus 3s step-end both;
}
.pq-qs-crew--wipe .pq-qs-crew__face--puh {
  animation: pq-qs-crew-puh 3s step-end both;
}
@keyframes pq-qs-crew-focus {
  0% { opacity: 1; }
  27% { opacity: 0; }
  78% { opacity: 1; }
}
@keyframes pq-qs-crew-puh {
  0% { opacity: 0; }
  27% { opacity: 1; }
  78% { opacity: 0; }
}
.pq-qs-crew--wipe .pq-qs-crew__puff {
  animation: pq-qs-crew-puff 0.5s ease-out infinite;
}
@keyframes pq-qs-crew-puff {
  from { transform: translate(-6px, 0) scale(0.6); opacity: 1; }
  to { transform: translate(10px, -6px) scale(1.3); opacity: 0; }
}
.pq-qs-crew--wipe .pq-qs-crew__sweat {
  animation: pq-qs-crew-fling 3s ease-out both;
}
@keyframes pq-qs-crew-fling {
  0%, 30% { transform: translate(0, 0); opacity: 0; }
  33% { transform: translate(0, 0); opacity: 1; }
  48% { transform: translate(18px, -14px); opacity: 1; }
  60% { transform: translate(30px, 10px); opacity: 0; }
  100% { transform: translate(30px, 10px); opacity: 0; }
}
/* Schwenk; der Arm am Griff folgt */
.pq-qs-crew--pan .pq-qs-crew__pan {
  animation: pq-qs-crew-pan 3s ease-in-out both;
}
.pq-qs-crew--pan .pq-qs-crew__grip {
  animation: pq-qs-crew-grip 3s ease-in-out both;
}
@keyframes pq-qs-crew-pan {
  0%, 20% { transform: rotate(0deg); }
  36% { transform: rotate(-7deg); }
  56% { transform: rotate(6deg); }
  66% { transform: rotate(6deg); }
  78%, 100% { transform: rotate(0deg); }
}
@keyframes pq-qs-crew-grip {
  0%, 20% { transform: translate(0, 0); }
  36% { transform: translate(2px, 10px); }
  56% { transform: translate(-1px, -8px); }
  66% { transform: translate(-1px, -8px); }
  78%, 100% { transform: translate(0, 0); }
}
.pq-qs-crew--pan .pq-qs-crew__tally {
  animation: pq-qs-crew-tally 0.5s step-end infinite;
}
@keyframes pq-qs-crew-tally {
  0% { opacity: 1; }
  50% { opacity: 0.25; }
}
.pq-qs-crew--pan .pq-qs-crew__body,
.pq-qs-crew--pan .pq-qs-crew__head {
  animation: pq-qs-crew-lean 3s ease-in-out both;
}
@keyframes pq-qs-crew-lean {
  0%, 20% { transform: translate(0, 0); }
  36% { transform: translate(3px, 3px); }
  56% { transform: translate(-3px, -2px); }
  78%, 100% { transform: translate(0, 0); }
}

/* ---------------------------------------------------------------------------------------------------------------------------- */
/* Kaffeetasse am Pult                                                                                                           */
/* ---------------------------------------------------------------------------------------------------------------------------- */
.pq-qs-crew__mug {
  position: absolute;
  right: 6vw;
  bottom: 8.5vh;
  animation: pq-qs-crew-mug-in 0.6s ease-out both;
}
.pq-qs-crew__mug .pq-qs-crew__fig {
  height: 11vh;
}
.pq-qs-crew__mug.is-off {
  animation: pq-qs-crew-mug-out 0.6s ease-in both;
}
@keyframes pq-qs-crew-mug-in {
  from { transform: translateY(1.5vh); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pq-qs-crew-mug-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
.pq-qs-crew__steam {
  opacity: 0;
  animation: pq-qs-crew-steam 3.6s ease-out infinite;
}
.pq-qs-crew__steam--2 {
  animation-delay: -1.2s;
}
.pq-qs-crew__steam--3 {
  animation-delay: -2.4s;
}
@keyframes pq-qs-crew-steam {
  0% { transform: translate(0, 0) scale(0.5, 0.5); opacity: 0; }
  25% { opacity: 0.85; }
  60% { transform: translate(4px, -26px) scale(1, 1); opacity: 0.6; }
  100% { transform: translate(-4px, -48px) scale(1.3, 1.1); opacity: 0; }
}
.pq-qs-crew__steam--heart {
  animation: pq-qs-crew-heart 10.8s ease-out -1s infinite;
}
@keyframes pq-qs-crew-heart {
  0%, 62% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  70% { transform: translate(0, -10px) scale(1); opacity: 0.95; }
  86% { transform: translate(3px, -38px) scale(1.25); opacity: 0.6; }
  94%, 100% { transform: translate(0, -52px) scale(1.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pq-qs-crew {
    display: none;
  }
}
