/* Dig: the layout comes from ../fishing/fishing.css (fz-*); this is the ground and the earthy look */

.dg-login-art { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 6px; }
.dg-login-art svg { width: 76px; height: 76px; }
.dg-login-art svg:nth-child(2) { width: 60px; height: 60px; }

/* the stage: the ground with your hole in the middle */
.dg-stage { background: #c98b4f; }
.dg-back-wrap, .dg-fx { position: absolute; inset: 0; pointer-events: none; }
.dg-back { display: block; width: 100%; height: 100%; }
.dg-stage.boom { animation: dg-shake .5s ease; }
.dg-stage.boom::after { content: ''; position: absolute; inset: 0; z-index: 5; background: #ff9b3d; animation: dg-flash .5s ease-out forwards; pointer-events: none; }
@keyframes dg-shake { 15% { transform: translate(-8px, 4px); } 30% { transform: translate(7px, -5px); } 45% { transform: translate(-5px, 3px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); } }
@keyframes dg-flash { from { opacity: .7; } to { opacity: 0; } }

.dg-shovel { position: absolute; left: 50%; bottom: calc(100% - var(--by, 24%) - 3%); width: 92px; aspect-ratio: 1; margin-left: -30px; pointer-events: none; transform-origin: 30% 90%; transition: bottom .25s ease; }
.dg-shovel svg { display: block; width: 100%; height: 100%; }
.dg-shovel.go { animation: dg-swing .35s ease-in-out; }
@keyframes dg-swing { 40% { transform: translate(-8%, 14%) rotate(-14deg); } 100% { transform: none; } }

/* on the stage: the finds of this hole at the top, how deep bottom left, Dig in the middle, Claim bottom right */
.dg-pile { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.dg-find { display: inline-flex; width: 34px; height: 34px; padding: 2px; border: 2.5px solid var(--tc); border-radius: 10px; background: #fff; }
.dg-find svg { width: 100%; height: 100%; }
.dg-depth { position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border: 2.5px solid #1d1b16; border-radius: 12px; background: #fff; color: #1d1b16; font: 600 1rem/1.2 var(--font-display); }
/* centred with margins, not a transform: .btn:hover moves it with transform, which made it jump sideways and shake */
.dg-dig { position: absolute; left: 0; right: 0; bottom: 14px; width: max-content; margin: 0 auto; font-size: 1.25rem; padding: 10px 34px 12px; }
.dg-full { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 7px 14px; font-weight: 700; background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px; white-space: nowrap; }
.fz-ui .dg-full { pointer-events: auto; }
/* a phone: Dig goes above the bottom row, so it never covers how deep or Claim */
@media (max-width: 560px) { .dg-dig, .dg-full { bottom: 66px; } }
.dg-res-art { display: block; width: 72px; height: 72px; margin: 6px auto 0; }

.dg-wait { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 6px; background: rgba(0, 0, 0, .35); pointer-events: none; }
.dg-wait i { display: block; height: 100%; width: 100%; background: #fff; }
.dg-wait.ready i { background: var(--good); }
.dg-wait.nope { animation: dg-no .3s ease; }
@keyframes dg-no { 25% { background: var(--bad); } }

/* what pops out of the hole */
.dg-pop, .dg-bomb, .dg-dirt { position: absolute; left: 50%; top: var(--by, 24%); transform: translate(-50%, -50%); pointer-events: none; }
.dg-pop { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: dg-up 1.4s ease-out forwards; }
.dg-pop svg { width: 72px; height: 72px; }
.dg-pop b { font: 700 .9rem/1 var(--font-display); color: #1d1b16; background: rgba(255, 255, 255, .9); padding: 3px 8px; border-radius: 9px; border: 2px solid var(--tc, #1d1b16); white-space: nowrap; }
@keyframes dg-up { 0% { transform: translate(-50%, -20%) scale(.4); opacity: 0; } 20% { transform: translate(-50%, -60%) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -110%) scale(1); opacity: 0; } }
.dg-bomb svg { width: 96px; height: 96px; animation: dg-bombpop 1.2s ease-out forwards; }
@keyframes dg-bombpop { 0% { transform: scale(.3); } 25% { transform: scale(1.3); } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.dg-dirt i { position: absolute; width: 12px; height: 12px; border: 2px solid #1d1b16; border-radius: 50%; background: #8a5a32; animation: dg-fly .6s ease-out forwards; }
.dg-dirt i:nth-child(1) { --x: -60px; --y: -50px; }
.dg-dirt i:nth-child(2) { --x: -25px; --y: -80px; }
.dg-dirt i:nth-child(3) { --x: 15px; --y: -70px; }
.dg-dirt i:nth-child(4) { --x: 50px; --y: -55px; }
.dg-dirt i:nth-child(5) { --x: 75px; --y: -30px; }
@keyframes dg-fly { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--x), var(--y)); opacity: 0; } }

/* the new look (p_digfx): the shovel bites in and pries, clods arc up and fall, finds jump out, bombs blow */
.dg-shovel.dig2 { animation: dg-dig2 .42s cubic-bezier(.4, 0, .3, 1); }
@keyframes dg-dig2 { 30% { transform: translate(5%, -14%) rotate(9deg); } 55% { transform: translate(-1%, 15%) rotate(-4deg); } 74% { transform: translate(-1%, 15%) rotate(-18deg); } }
.dg-clods, .dg-pop2, .dg-boom2 { position: absolute; left: 50%; top: var(--by, 24%); width: 0; height: 0; pointer-events: none; }
.dg-clods i { position: absolute; left: 0; top: 0; animation: dg-cx .8s var(--d) linear both; }
.dg-clods b { display: block; border: 2px solid #1d1b16; border-radius: 48% 52% 40% 60% / 58% 44% 56% 42%; background: var(--c); animation: dg-cy .8s var(--d) both; }
@keyframes dg-cx { to { transform: translateX(var(--x)); } }
@keyframes dg-cy {
  0% { transform: translateY(0) rotate(0); animation-timing-function: cubic-bezier(.25, .7, .45, 1); }
  42% { transform: translateY(var(--h)) rotate(calc(var(--r) * .4)); animation-timing-function: cubic-bezier(.55, 0, .85, .45); }
  80% { opacity: 1; }
  100% { transform: translateY(var(--f)) rotate(var(--r)); opacity: 0; }
}
.dg-dust { position: absolute; left: -52px; top: -16px; width: 104px; height: 30px; border-radius: 50%; background: var(--c); opacity: 0; animation: dg-dust .55s ease-out; }
@keyframes dg-dust { from { transform: scale(.3); opacity: .6; } to { transform: translateY(-10px) scale(1.4, 1.15); opacity: 0; } }

.dg-pop2 .dg-item { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; animation: dg-tx 1.75s linear both; }
.dg-pop2 .dg-item > span { display: block; width: 100%; height: 100%; animation: dg-ty 1.75s both; }
.dg-pop2 .dg-item svg { display: block; width: 100%; height: 100%; }
@keyframes dg-tx { 0% { transform: translateX(0); } 36%, 100% { transform: translateX(var(--dx)); } }
@keyframes dg-ty {
  0% { transform: translateY(12px) scale(.45) rotate(calc(var(--sp) * -1)); opacity: 0; animation-timing-function: cubic-bezier(.25, .7, .5, 1); }
  6% { opacity: 1; }
  18% { transform: translateY(var(--pk)) scale(1) rotate(calc(var(--sp) * -.45)); animation-timing-function: cubic-bezier(.5, 0, .75, .5); }
  36% { transform: translateY(var(--dy)) scale(1.12, .86) rotate(0); animation-timing-function: cubic-bezier(.3, .6, .4, 1); }
  43% { transform: translateY(calc(var(--dy) - 9px)) scale(.97, 1.04); animation-timing-function: ease-in; }
  49% { transform: translateY(var(--dy)) scale(1); }
  82% { transform: translateY(var(--dy)); opacity: 1; }
  100% { transform: translateY(calc(var(--dy) - 34px)) scale(.92); opacity: 0; }
}
.dg-pop2 b { position: absolute; left: var(--dx); top: calc(var(--dy) + 44px); font: 700 .9rem/1 var(--font-display); color: #1d1b16; background: #fff; padding: 4px 9px; border-radius: 9px; border: 2.5px solid var(--tc, #1d1b16); white-space: nowrap; animation: dg-tag 1.75s both; }
@keyframes dg-tag {
  0%, 38% { transform: translate(-50%, 8px); opacity: 0; }
  48% { transform: translate(-50%, 0); opacity: 1; }
  82% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -34px); opacity: 0; }
}
.dg-glow { position: absolute; left: calc(var(--dx) - 64px); top: calc(var(--dy) - 64px); width: 128px; height: 128px; border-radius: 50%; background: var(--tc); opacity: 0; animation: dg-glow 1.75s ease-out both; }
@keyframes dg-glow { 0%, 34% { transform: scale(.2); opacity: 0; } 46% { transform: scale(1); opacity: .45; } 82% { transform: scale(1.1); opacity: .3; } 100% { transform: translateY(-34px) scale(1.2); opacity: 0; } }

.dg-boom2 > * { position: absolute; }
.dg-bombi { left: -40px; top: -40px; width: 80px; height: 80px; animation: dg-bombup .44s both; }
.dg-bombi svg { display: block; width: 100%; height: 100%; }
@keyframes dg-bombup {
  0% { transform: translateY(16px) scale(.4); opacity: 0; animation-timing-function: cubic-bezier(.2, .8, .4, 1); }
  14% { opacity: 1; }
  50% { transform: translateY(-58px) scale(1) rotate(0); }
  64% { transform: translateY(-56px) scale(1.05) rotate(-7deg); }
  78% { transform: translateY(-56px) scale(1.12) rotate(7deg); }
  92% { transform: translateY(-56px) scale(1.24) rotate(-3deg); opacity: 1; }
  100% { transform: translateY(-56px) scale(1.34); opacity: 0; }
}
.dg-fire { left: -66px; top: -122px; width: 132px; height: 132px; opacity: 0; animation: dg-fire .7s .42s forwards; }
.dg-fire svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes dg-fire { 0% { transform: scale(.25); opacity: 1; animation-timing-function: cubic-bezier(.2, .9, .3, 1); } 30% { transform: scale(1.12); opacity: 1; } 55% { transform: scale(1) rotate(8deg); opacity: 1; } 100% { transform: scale(1.06) rotate(14deg); opacity: 0; } }
.dg-ring { left: -60px; top: -116px; width: 120px; height: 120px; border: 5px solid #fff; border-radius: 50%; opacity: 0; animation: dg-ring .5s .42s ease-out forwards; }
@keyframes dg-ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.5); opacity: 0; } }
.dg-smoke { width: 54px; height: 54px; border: 2.5px solid #1d1b16; border-radius: 50%; background: #9a948a; opacity: 0; animation: dg-smoke 1s .5s ease-out both; }
.dg-smoke:nth-child(4) { left: -66px; top: -96px; --sx: -26px; }
.dg-smoke:nth-child(5) { left: -30px; top: -130px; --sx: -8px; animation-delay: .54s; }
.dg-smoke:nth-child(6) { left: 8px; top: -122px; --sx: 14px; animation-delay: .58s; }
.dg-smoke:nth-child(7) { left: 22px; top: -86px; --sx: 30px; animation-delay: .52s; }
.dg-smoke:nth-child(8) { left: -26px; top: -76px; --sx: 0px; animation-delay: .62s; background: #b3ada3; }
@keyframes dg-smoke { 0% { transform: scale(.2); opacity: 0; } 18% { transform: scale(.9); opacity: 1; } 100% { transform: translate(var(--sx), -54px) scale(1.25); opacity: 0; } }
.dg-lost .dg-find { animation: dg-lose .6s forwards; }
.dg-lost > b { opacity: 0; transition: opacity .25s; }
.dg-pile.dg-lost { background-color: transparent; border-color: transparent; box-shadow: none; transition: background-color .3s .25s, border-color .3s .25s, box-shadow .3s .25s; }
@keyframes dg-lose {
  0% { transform: none; animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  22% { transform: translate(calc(var(--lx) * .3), -12px) rotate(calc(var(--lr) * .3)); animation-timing-function: cubic-bezier(.6, 0, .9, .5); }
  70% { opacity: 1; }
  100% { transform: translate(var(--lx), 150px) rotate(var(--lr)); opacity: 0; }
}
.dg-stage.boom2 { animation: dg-shake2 .6s .42s ease-out; }
.dg-stage.boom2::after { content: ''; position: absolute; inset: 0; z-index: 5; background: #fff1c9; opacity: 0; animation: dg-flash2 .4s .42s ease-out; pointer-events: none; }
@keyframes dg-flash2 { from { opacity: .8; } to { opacity: 0; } }
@keyframes dg-shake2 { 8% { transform: translate(-11px, 6px) rotate(-.7deg); } 20% { transform: translate(10px, -6px) rotate(.6deg); } 34% { transform: translate(-7px, 4px) rotate(-.3deg); } 50% { transform: translate(5px, -3px); } 66% { transform: translate(-3px, 2px); } 82% { transform: translate(1px, -1px); } }
@media (prefers-reduced-motion: reduce) {
  .dg-shovel.dig2, .dg-stage.boom2, .dg-pop2 b, .dg-lost .dg-find { animation: none; }
  .dg-pop2 .dg-item, .dg-pop2 .dg-item > span { animation: none; }
  .dg-pop2 .dg-item { transform: translate(var(--dx), var(--dy)); }
  .dg-pop2 b { transform: translateX(-50%); }
  .dg-stage.boom2::after, .dg-clods, .dg-pop2 .dg-glow, .dg-boom2 { display: none; }
}

/* sack and prices: soil in place of water */
.dg-tile { background: linear-gradient(180deg, #f6e6cf, #e6caa2); }
.dg-tile:hover { background: linear-gradient(180deg, #fbefdd, #eed5b2); }
.dg-tile-art { width: 64px; height: 64px; margin: 4px 0; }
.dg-tile.on { background: #fff3c4; }
.dg-mk-art { width: 40px; height: 40px; padding: 3px; background: #f1dcbd; }

/* odds: under More in Find prices */
.dg-more { margin-top: 10px; }
.dg-odds { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .9rem; }
.dg-odds th, .dg-odds td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.dg-odds th:first-child, .dg-odds td:first-child { text-align: left; }
.dg-odds tr.now td { font-weight: 800; background: var(--soft); }
.dg-odds-wrap { overflow-x: auto; }
