/* Сцена: фото + скелет + мышцы + руки (см. js/stage.js). --u — единиц кадра на пиксель экрана. */

.stage {
  position: relative;
  overflow: hidden;
  --muscle: #E5484D;
  --bone: rgba(255, 255, 255, .62);
  --bone-line: rgba(255, 255, 255, .95);
}

.a3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stage-load {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px -8px rgba(16, 24, 40, .45);
  font: 600 12.5px/1.2 "Onest", system-ui, sans-serif;
  color: #0E1116;
  white-space: nowrap;
  pointer-events: none;
}
.stage-load i {
  width: 14px;
  height: 14px;
  border: 2px solid #D7F2EC;
  border-top-color: #0A8F7C;
  border-radius: 50%;
  animation: st-spin .8s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

.stage-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.photo-bg { fill: #1A1F27; }
.photo { filter: saturate(.72) contrast(.96); }
.silhouette { stroke: rgba(14, 17, 22, .08); stroke-width: calc(var(--u) * 1px); }

/* кости */
.layer-bones { filter: drop-shadow(0 0 calc(var(--u) * 1.2px) rgba(10, 20, 30, .45)); transition: opacity .35s; }
.bone { fill: var(--bone); stroke: var(--bone-line); stroke-width: calc(var(--u) * 1px); }
.bone-dark { fill: rgba(255, 255, 255, .8); }
.bone-line, .rib { fill: none; stroke: var(--bone); stroke-linecap: round; }
.rib { stroke: rgba(255, 255, 255, .5); }
.stage.no-bones .layer-bones { opacity: 0; }

/* мышцы */
.layer-muscles, .layer-hot { transition: opacity .35s; }
.m-body { fill: rgba(229, 72, 77, .16); stroke: rgba(229, 72, 77, .5); stroke-width: calc(var(--u) * .8px); stroke-linejoin: round; }
.m-fibers { fill: none; stroke: rgba(229, 72, 77, .28); stroke-width: calc(var(--u) * .6px); }
.m.hot .m-body {
  fill: url(#hotFill);
  fill-opacity: .82;
  stroke: #fff;
  stroke-width: calc(var(--u) * 1.6px);
  animation: hot-pulse 2.4s ease-in-out infinite;
}
.m.hot .m-fibers { stroke: rgba(255, 255, 255, .5); stroke-width: calc(var(--u) * .8px); }
.layer-hot { filter: drop-shadow(0 0 calc(var(--u) * 6px) rgba(229, 72, 77, .55)); }
@keyframes hot-pulse { 50% { fill-opacity: .62; } }
.stage.no-muscles .layer-muscles, .stage.no-muscles .layer-hot { opacity: 0; }

.tp {
  fill: #fff;
  stroke: var(--muscle);
  stroke-width: calc(var(--u) * 2.5px);
}

/* зоны */
.zone {
  fill: rgba(10, 143, 124, .1);
  stroke: rgba(10, 143, 124, .75);
  stroke-width: calc(var(--u) * 1.5px);
  stroke-dasharray: calc(var(--u) * 5px) calc(var(--u) * 4px);
  cursor: pointer;
  transition: fill .25s, stroke .25s;
  -webkit-tap-highlight-color: transparent;
}
.zone:hover { fill: rgba(10, 143, 124, .22); }
.zone.on {
  fill: rgba(229, 72, 77, .5);
  stroke: #fff;
  stroke-dasharray: none;
  stroke-width: calc(var(--u) * 2px);
}

/* подсказки траектории */
.guide, .guide-tick {
  fill: none;
  stroke: rgba(255, 255, 255, .9);
  stroke-width: 2px;
  stroke-dasharray: 2 6;
  stroke-linecap: round;
  animation: guide-flow 1.2s linear infinite;
}
.guide-tick { stroke-dasharray: none; }
.arrow-head { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes guide-flow { to { stroke-dashoffset: -16; } }

/* руки */
.layer-hands { transition: opacity .3s; }
.stage.no-hands .layer-hands, .stage.no-hands .layer-guide, .stage.no-hands .fx { opacity: 0; }
.hand {
  filter: drop-shadow(0 calc(var(--u) * (3px + var(--lift, 0) * 6px)) calc(var(--u) * (5px + var(--lift, 0) * 6px)) rgba(10, 20, 30, .38));
  transition: opacity .25s;
}
.hand-outline { fill: none; stroke: rgba(14, 17, 22, .55); stroke-width: .07; stroke-linejoin: round; }
.hand-outline rect, .hand-outline path { fill: none; }
.hand-face { opacity: .86; }
.hand-face rect, .hand-face path { stroke: none; }
.hand-wrist { stroke: none; }
.nail { fill: #F1E6E2; stroke: rgba(14, 17, 22, .18); stroke-width: .018; }
.crease, .tendon { fill: none; stroke: rgba(14, 17, 22, .1); stroke-width: .02; stroke-linecap: round; }

/* эффекты */
.fx-trail { fill: none; stroke: #0A8F7C; stroke-width: calc(var(--u) * 2.5px); stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.fx-progress { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: calc(var(--u) * 5px); stroke-linecap: round; filter: drop-shadow(0 0 calc(var(--u) * 4px) #0A8F7C); }
.fx-squeeze { fill: rgba(255, 255, 255, .25); stroke: rgba(255, 255, 255, .8); stroke-width: calc(var(--u) * 1.5px); opacity: 0; }
.fx-ring-bg, .fx-ring { fill: none; opacity: 0; }
.fx-ring-bg { stroke: rgba(255, 255, 255, .45); stroke-width: calc(var(--u) * 4px); }
.fx-ring {
  stroke: #0A8F7C;
  stroke-width: calc(var(--u) * 4px);
  stroke-linecap: round;
  stroke-dasharray: 1;
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-90deg);
}
.fx-ring-text { fill: #fff; font-weight: 700; paint-order: stroke; stroke: rgba(10, 20, 30, .55); stroke-width: calc(var(--u) * 3px); }
.fx-ripple { fill: none; stroke: #fff; stroke-width: calc(var(--u) * 2px); }
.fx-point { fill: rgba(255, 255, 255, .7); stroke: #E5484D; stroke-width: 2px; }
.fx-point.on { fill: #fff; stroke: #0A8F7C; stroke-width: 3px; }

/* суставы для правки */
.handle-lines { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 2px; stroke-dasharray: 4 4; }
.handle { cursor: grab; }
.handle.drag { cursor: grabbing; }
.handle-hit { fill: transparent; }
.handle-dot { fill: #0A8F7C; stroke: #fff; stroke-width: 3px; transition: r .2s; }
.handle.drag .handle-dot { fill: #fff; stroke: #0A8F7C; }

/* подписи мышц */
.stage-labels { position: absolute; inset: 0; pointer-events: none; }
.mlabel {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0;
  will-change: transform;
}
.mlabel i {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .9);
  flex: none;
}
.mlabel span {
  position: absolute;
  right: 14px;
  bottom: 10px;
  display: grid;
  width: max-content;
  max-width: 170px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px -8px rgba(16, 24, 40, .45);
  font-size: 12px;
  line-height: 1.2;
  color: #0E1116;
}
.mlabel.flip span { right: auto; left: 14px; }
.mlabel b { font-weight: 650; }
.mlabel small { color: #6B7280; font-size: 10.5px; font-style: italic; }
