/* v17 — fixed-camera excavation and articulated shovel stroke.
   The grave is drawn locally on a transparent canvas. No full-frame photo or
   scene layer is scaled toward the player. */

.dig-canvas {
  position: absolute;
  z-index: 17;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.photo-dig-layer {
  display: none !important;
}

/* The canvas owns the opening, walls, cracks, rim and side piles. The old CSS
   excavation remains only as inaccessible fallback markup. */
.grave-zone::before,
.grave-zone::after,
.grave-ground,
.grave-mouth,
.grave-shaft,
.grave-rim,
.tool-marks,
.footprints {
  visibility: hidden !important;
  opacity: 0 !important;
  animation: none !important;
  transition: none !important;
}

.dirt-pile {
  visibility: hidden !important;
  opacity: 0 !important;
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  transition: none !important;
}

.dirt-pile::before,
.dirt-pile::after,
.dirt-pile > i {
  display: none !important;
}

/* The pointer moves the anchor. The stroke itself pivots around the player's
   lower grip: wind-up, blade contact, levering, lift and side throw. There is
   deliberately no scale() in any keyframe. */
.shovel-tool {
  --shovel-stroke-duration: 600ms;
  transform: rotate(8deg);
  transform-origin: 51% 83% !important;
  backface-visibility: hidden;
}

.shovel-arms-motion,
.shovel-geometry-motion,
.shovel-hands-motion {
  transform-box: view-box;
  will-change: transform;
}

.shovel-arm,
.shovel-hand,
.shovel-dirt-load {
  transform-box: fill-box;
  will-change: transform, opacity;
}

.shovel-arms-motion { transform-origin: 51% 88%; }
.shovel-geometry-motion { transform-origin: 51% 79%; }
.shovel-hands-motion { transform-origin: 51% 80%; }
.shovel-arm--left { transform-origin: 58% 92%; }
.shovel-arm--right { transform-origin: 42% 92%; }
.shovel-hand--upper { transform-origin: 50% 58%; }
.shovel-hand--lower { transform-origin: 50% 70%; }
.shovel-dirt-load { opacity: 0; transform-origin: 50% 80%; }

.shovel-tool.is-digging-left,
.shovel-tool.is-digging-right {
  animation-duration: var(--shovel-stroke-duration) !important;
  animation-timing-function: cubic-bezier(0.18, 0.72, 0.16, 1) !important;
  animation-fill-mode: both !important;
}

.shovel-tool.is-digging-left {
  animation-name: shovel-body-left-v17 !important;
}

.shovel-tool.is-digging-right {
  animation-name: shovel-body-right-v17 !important;
}

.shovel-tool.is-digging-left .shovel-geometry-motion {
  animation: shovel-geometry-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-geometry-motion {
  animation: shovel-geometry-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-hands-motion {
  animation: shovel-hands-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-hands-motion {
  animation: shovel-hands-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-arms-motion {
  animation: shovel-arms-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-arms-motion {
  animation: shovel-arms-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-arm--left {
  animation: shovel-leading-arm-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-arm--right {
  animation: shovel-trailing-arm-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-arm--left {
  animation: shovel-trailing-arm-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-arm--right {
  animation: shovel-leading-arm-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-hand--upper {
  animation: shovel-upper-hand-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-hand--upper {
  animation: shovel-upper-hand-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-hand--lower {
  animation: shovel-lower-hand-left-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-right .shovel-hand--lower {
  animation: shovel-lower-hand-right-v17 var(--shovel-stroke-duration) cubic-bezier(0.18, 0.72, 0.16, 1) both !important;
}

.shovel-tool.is-digging-left .shovel-dirt-load {
  animation: shovel-load-left-v17 var(--shovel-stroke-duration) linear both !important;
}

.shovel-tool.is-digging-right .shovel-dirt-load {
  animation: shovel-load-right-v17 var(--shovel-stroke-duration) linear both !important;
}

@keyframes shovel-body-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(8deg); }
  10% { transform: translate3d(4px, -7px, 0) rotate(13deg); }
  30% { transform: translate3d(-1px, 29px, 0) rotate(4deg); }
  42% { transform: translate3d(-4px, 38px, 0) rotate(0deg); }
  55% { transform: translate3d(-14px, 21px, 0) rotate(-10deg); }
  70% { transform: translate3d(-45px, -5px, 0) rotate(-27deg); }
  81% { transform: translate3d(-74px, -39px, 0) rotate(-43deg); }
  91% { transform: translate3d(-22px, -13px, 0) rotate(-9deg); }
}

@keyframes shovel-body-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(8deg); }
  10% { transform: translate3d(-4px, -7px, 0) rotate(3deg); }
  30% { transform: translate3d(1px, 29px, 0) rotate(13deg); }
  42% { transform: translate3d(4px, 38px, 0) rotate(17deg); }
  55% { transform: translate3d(14px, 21px, 0) rotate(27deg); }
  70% { transform: translate3d(45px, -5px, 0) rotate(44deg); }
  81% { transform: translate3d(74px, -39px, 0) rotate(59deg); }
  91% { transform: translate3d(22px, -13px, 0) rotate(24deg); }
}

@keyframes shovel-geometry-left-v17 {
  0%, 10%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  30% { transform: translate3d(1px, 9px, 0) rotate(2deg); }
  42% { transform: translate3d(-1px, 14px, 0) rotate(-3deg); }
  55% { transform: translate3d(-6px, 5px, 0) rotate(-8deg); }
  70% { transform: translate3d(-13px, -6px, 0) rotate(-13deg); }
  81% { transform: translate3d(-19px, -13px, 0) rotate(-17deg); }
  91% { transform: translate3d(-4px, -3px, 0) rotate(-4deg); }
}

@keyframes shovel-geometry-right-v17 {
  0%, 10%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  30% { transform: translate3d(-1px, 9px, 0) rotate(-2deg); }
  42% { transform: translate3d(1px, 14px, 0) rotate(3deg); }
  55% { transform: translate3d(6px, 5px, 0) rotate(8deg); }
  70% { transform: translate3d(13px, -6px, 0) rotate(13deg); }
  81% { transform: translate3d(19px, -13px, 0) rotate(17deg); }
  91% { transform: translate3d(4px, -3px, 0) rotate(4deg); }
}

@keyframes shovel-hands-left-v17 {
  0%, 10%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  30% { transform: translate3d(-1px, 6px, 0) rotate(-1deg); }
  42% { transform: translate3d(-3px, 9px, 0) rotate(-3deg); }
  55% { transform: translate3d(-7px, 3px, 0) rotate(-6deg); }
  70% { transform: translate3d(-12px, -4px, 0) rotate(-10deg); }
  81% { transform: translate3d(-16px, -9px, 0) rotate(-13deg); }
  91% { transform: translate3d(-3px, -2px, 0) rotate(-3deg); }
}

@keyframes shovel-hands-right-v17 {
  0%, 10%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  30% { transform: translate3d(1px, 6px, 0) rotate(1deg); }
  42% { transform: translate3d(3px, 9px, 0) rotate(3deg); }
  55% { transform: translate3d(7px, 3px, 0) rotate(6deg); }
  70% { transform: translate3d(12px, -4px, 0) rotate(10deg); }
  81% { transform: translate3d(16px, -9px, 0) rotate(13deg); }
  91% { transform: translate3d(3px, -2px, 0) rotate(3deg); }
}

@keyframes shovel-arms-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(2px, 5px, 0) rotate(2deg); }
  70% { transform: translate3d(9px, -1px, 0) rotate(7deg); }
  81% { transform: translate3d(14px, -5px, 0) rotate(10deg); }
  91% { transform: translate3d(3px, -1px, 0) rotate(2deg); }
}

@keyframes shovel-arms-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(-2px, 5px, 0) rotate(-2deg); }
  70% { transform: translate3d(-9px, -1px, 0) rotate(-7deg); }
  81% { transform: translate3d(-14px, -5px, 0) rotate(-10deg); }
  91% { transform: translate3d(-3px, -1px, 0) rotate(-2deg); }
}

@keyframes shovel-leading-arm-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(-2px, 4px, 0) rotate(-4deg); }
  81% { transform: translate3d(-10px, -5px, 0) rotate(-13deg); }
}

@keyframes shovel-trailing-arm-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(1px, 2px, 0) rotate(2deg); }
  81% { transform: translate3d(-3px, 1px, 0) rotate(7deg); }
}

@keyframes shovel-leading-arm-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(2px, 4px, 0) rotate(4deg); }
  81% { transform: translate3d(10px, -5px, 0) rotate(13deg); }
}

@keyframes shovel-trailing-arm-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(-1px, 2px, 0) rotate(-2deg); }
  81% { transform: translate3d(3px, 1px, 0) rotate(-7deg); }
}

@keyframes shovel-upper-hand-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(-2px, 3px, 0) rotate(-4deg); }
  81% { transform: translate3d(-8px, -4px, 0) rotate(-12deg); }
}

@keyframes shovel-upper-hand-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(2px, 3px, 0) rotate(4deg); }
  81% { transform: translate3d(8px, -4px, 0) rotate(12deg); }
}

@keyframes shovel-lower-hand-left-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(-1px, 4px, 0) rotate(-2deg); }
  81% { transform: translate3d(-6px, -3px, 0) rotate(-8deg); }
}

@keyframes shovel-lower-hand-right-v17 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  42% { transform: translate3d(1px, 4px, 0) rotate(2deg); }
  81% { transform: translate3d(6px, -3px, 0) rotate(8deg); }
}

@keyframes shovel-load-left-v17 {
  0%, 34%, 91%, 100% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  43% { opacity: 0.45; }
  50%, 70% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  80% { opacity: 0.75; transform: translate3d(-5px, -4px, 0) rotate(-7deg); }
  88% { opacity: 0; transform: translate3d(-30px, -22px, 0) rotate(-24deg); }
}

@keyframes shovel-load-right-v17 {
  0%, 34%, 91%, 100% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  43% { opacity: 0.45; }
  50%, 70% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  80% { opacity: 0.75; transform: translate3d(5px, -4px, 0) rotate(7deg); }
  88% { opacity: 0; transform: translate3d(30px, -22px, 0) rotate(24deg); }
}

@media (prefers-reduced-motion: reduce) {
  .shovel-tool {
    --shovel-stroke-duration: 230ms;
  }
}
