#basket-court {
  --goose-dribble-x: 20.5%;
  --goose-hold-y: 63%;
  --goose-release-x: 27%;
  isolation: isolate;
  background: radial-gradient(ellipse at 84% 24%, #ad98ff38, transparent 48%),
              linear-gradient(180deg, #0c1021 0 52%, #30223b 53%, #141022 100%);
}
#basket-court .court-lines {
  background: repeating-linear-gradient(90deg, #c7834816 0 2px, transparent 2px 7%),
              repeating-linear-gradient(0deg, #edbe9233 0 1px, #5b342a66 1px 12px, #77463566 12px 24px);
  box-shadow: inset 0 14px 36px #0a061d8c;
}
#basket-court .basket-backboard {
  background: linear-gradient(148deg,#e3f6ff45 0 24%,#99c8f219 25% 71%,#aab8f63d 72%);
  box-shadow: 3px 5px 0 #263549, 0 8px 22px #030611b0;
}
#basket-court .basket-ball {
  border: 0;
  background: radial-gradient(circle at 29% 22%,#ffdd9a,#e98231 41%,#99401f 76%,#421408 100%);
  box-shadow: inset 0 0 1px 1px #72341e, 0 4px 7px #07040c85;
  overflow: hidden;
}
#basket-court .basket-ball::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .35;
  border-radius: 50%;
  background: radial-gradient(circle, #5d290b 20%, transparent 35%) 0 0 / 3px 3px;
}
#basket-court .basket-ball::after {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 50%, transparent 34%, #3d190f 36% 39%, transparent 41%),
              linear-gradient(90deg, transparent 48%, #3d190f 49% 52%, transparent 53%);
  clip-path: circle(39%);
  transform: rotate(33deg);
}
#basket-court .basket-shot-call {
  position: absolute;
  right: 4%;
  top: 54%;
  z-index: 10;
  color: #fff;
  font-size: clamp(11px, 2.6vw, 19px);
  font-weight: 800;
  text-shadow: 0 2px 10px #06040f, 0 0 18px #b39cff;
  opacity: 0;
  pointer-events: none;
}
#basket-court.basket-throw .basket-shot-call {
  animation: basket-call 240ms calc(var(--shot-duration) * .77) ease-out forwards;
}
#basket-court.basket-lose .basket-rim {
  animation: rimVibrate 440ms calc(var(--shot-duration) * .77) ease-out;
}
@keyframes basket-call {
  from { opacity: 0; transform: translateY(10px) scale(.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gooseSwish {
  0%, 8% { left:var(--goose-dribble-x); top:var(--goose-hold-y); transform:translate(-50%,-50%) scale(1,1) rotate(0); }
  13% { left:calc(var(--goose-dribble-x) - 3%); top:88%; transform:translate(-50%,-50%) scale(1.08,.86) rotate(25deg); animation-timing-function:cubic-bezier(.18,.56,.54,1); }
  20% { left:calc(var(--goose-dribble-x) - 8%); top:63%; transform:translate(-50%,-50%) scale(1,1) rotate(64deg); animation-timing-function:cubic-bezier(.22,.65,.55,1); }
  25% { left:calc(var(--goose-dribble-x) - 4%); top:51%; transform:translate(-50%,-50%) scale(1,1) rotate(76deg); }
  27% { left:calc(var(--goose-dribble-x) - 4%); top:51%; transform:translate(-50%,-50%) scale(1,1) rotate(76deg); animation-timing-function:cubic-bezier(.35,0,.75,1); }
  30% { left:var(--goose-dribble-x); top:62%; transform:translate(-50%,-50%) scale(1,1) rotate(52deg); animation-timing-function:cubic-bezier(.2,.65,.48,1); }
  32% { left:calc(var(--goose-release-x) - 2%); top:55%; transform:translate(-50%,-50%) scale(1,1) rotate(57deg); }
  34% { left:var(--goose-release-x); top:49%; transform:translate(-50%,-50%) scale(1,1) rotate(65deg); animation-timing-function:cubic-bezier(.2,.55,.6,1); }
  37% { left:calc(var(--goose-release-x) + 2%); top:42%; transform:translate(-50%,-50%) scale(.99,.99) rotate(102deg); }
  41% { left:32%; top:35%; transform:translate(-50%,-50%) scale(.97,.97) rotate(157deg); }
  45% { left:35%; top:31%; transform:translate(-50%,-50%) scale(.96,.96) rotate(210deg); }
  58% { left:54%; top:17%; transform:translate(-50%,-50%) scale(.9,.9) rotate(400deg); }
  68% { left:70%; top:22%; transform:translate(-50%,-50%) scale(.85,.85) rotate(550deg); }
  77% { left:85%; top:43%; transform:translate(-50%,-50%) scale(.81,.81) rotate(690deg); animation-timing-function:cubic-bezier(.3,.02,.8,.7); }
  91% { left:85%; top:88%; transform:translate(-50%,-50%) scale(.88,.74) rotate(815deg); animation-timing-function:cubic-bezier(.14,.65,.45,1); }
  96% { left:87%; top:81%; transform:translate(-50%,-50%) scale(.84,.84) rotate(870deg); animation-timing-function:cubic-bezier(.4,.05,.88,.78); }
  100% { left:88%; top:86%; transform:translate(-50%,-50%) scale(.84,.84) rotate(900deg); }
}
@keyframes gooseMiss {
  0%, 8% { left:var(--goose-dribble-x); top:var(--goose-hold-y); transform:translate(-50%,-50%) scale(1,1) rotate(0); }
  13% { left:calc(var(--goose-dribble-x) - 3%); top:88%; transform:translate(-50%,-50%) scale(1.08,.86) rotate(25deg); animation-timing-function:cubic-bezier(.18,.56,.54,1); }
  20% { left:calc(var(--goose-dribble-x) - 8%); top:63%; transform:translate(-50%,-50%) scale(1,1) rotate(64deg); animation-timing-function:cubic-bezier(.22,.65,.55,1); }
  25% { left:calc(var(--goose-dribble-x) - 4%); top:51%; transform:translate(-50%,-50%) scale(1,1) rotate(76deg); }
  27% { left:calc(var(--goose-dribble-x) - 4%); top:51%; transform:translate(-50%,-50%) scale(1,1) rotate(76deg); animation-timing-function:cubic-bezier(.35,0,.75,1); }
  30% { left:var(--goose-dribble-x); top:62%; transform:translate(-50%,-50%) scale(1,1) rotate(52deg); animation-timing-function:cubic-bezier(.2,.65,.48,1); }
  32% { left:calc(var(--goose-release-x) - 2%); top:55%; transform:translate(-50%,-50%) scale(1,1) rotate(57deg); }
  34% { left:var(--goose-release-x); top:49%; transform:translate(-50%,-50%) scale(1,1) rotate(65deg); animation-timing-function:cubic-bezier(.2,.55,.6,1); }
  37% { left:calc(var(--goose-release-x) + 2%); top:42%; transform:translate(-50%,-50%) scale(.99,.99) rotate(102deg); }
  41% { left:32%; top:35%; transform:translate(-50%,-50%) scale(.97,.97) rotate(157deg); }
  45% { left:35%; top:31%; transform:translate(-50%,-50%) scale(.96,.96) rotate(210deg); }
  58% { left:54%; top:17%; transform:translate(-50%,-50%) scale(.9,.9) rotate(400deg); }
  68% { left:69%; top:23%; transform:translate(-50%,-50%) scale(.85,.85) rotate(550deg); }
  77% { left:78%; top:43%; transform:translate(-50%,-50%) scale(.82,.82) rotate(680deg); animation-timing-function:cubic-bezier(.3,.02,.8,.7); }
  85% { left:69%; top:34%; transform:translate(-50%,-50%) scale(.86,.86) rotate(560deg); animation-timing-function:cubic-bezier(.32,.05,.8,.68); }
  94% { left:55%; top:69%; transform:translate(-50%,-50%) scale(.91,.91) rotate(380deg); }
  100% { left:49%; top:88%; transform:translate(-50%,-50%) scale(1,.83) rotate(295deg); }
}
@media (prefers-reduced-motion: reduce) {
  #basket-court.basket-throw .basket-shot-call,
  #basket-court.basket-lose .basket-rim { animation: none; }
  #basket-court.basket-throw .basket-shot-call { opacity: 1; }
}

@media (max-width: 600px) {
  #basket-court { --goose-dribble-x: 19%; --goose-release-x: 25%; }
}
@media (prefers-reduced-motion: no-preference) {
  #basket-court:not(.basket-throw) .basket-ball {
    left: var(--goose-dribble-x);
    top: var(--goose-hold-y);
  }
}

#basket-court .basket-ball-shadow {
  position: absolute;
  left: var(--goose-dribble-x);
  top: 89%;
  width: 8%;
  height: 5%;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%,-50%);
  background: radial-gradient(ellipse, #07040dd9, transparent 72%);
  opacity: .46;
}
@media (prefers-reduced-motion: no-preference) {
  #basket-court.basket-throw .basket-ball-shadow {
    animation: basket-shadow-swish var(--shot-duration) linear both;
  }
  #basket-court.basket-throw.basket-lose .basket-ball-shadow {
    animation-name: basket-shadow-miss;
  }
}
@media (prefers-reduced-motion: reduce) {
  #basket-court.basket-throw .basket-ball-shadow { display: none; }
}
@keyframes basket-shadow-swish {
  0%, 8% { left: var(--goose-dribble-x); opacity: 0.52; transform: translate(-50%,-50%) scale(0.84); }
  13% { left: calc(var(--goose-dribble-x) - 3%); opacity: 0.73; transform: translate(-50%,-50%) scale(0.65); animation-timing-function: cubic-bezier(.18,.56,.54,1); }
  20% { left: calc(var(--goose-dribble-x) - 8%); opacity: 0.48; transform: translate(-50%,-50%) scale(0.87); animation-timing-function: cubic-bezier(.22,.65,.55,1); }
  25% { left: calc(var(--goose-dribble-x) - 4%); opacity: 0.36; transform: translate(-50%,-50%) scale(0.98); }
  27% { left: calc(var(--goose-dribble-x) - 4%); opacity: 0.36; transform: translate(-50%,-50%) scale(0.98); animation-timing-function: cubic-bezier(.35,0,.75,1); }
  30% { left: var(--goose-dribble-x); opacity: 0.47; transform: translate(-50%,-50%) scale(0.88); animation-timing-function: cubic-bezier(.2,.65,.48,1); }
  32% { left: calc(var(--goose-release-x) - 2%); opacity: .40; transform: translate(-50%,-50%) scale(.94); }
  34% { left: var(--goose-release-x); opacity: 0.34; transform: translate(-50%,-50%) scale(0.99); animation-timing-function: cubic-bezier(.2,.55,.6,1); }
  37% { left: calc(var(--goose-release-x) + 2%); opacity: .27; transform: translate(-50%,-50%) scale(1.05); }
  41% { left: 32%; opacity: .20; transform: translate(-50%,-50%) scale(1.12); }
  45% { left: 35%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.15); }
  58% { left: 54%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.27); }
  68% { left: 70%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.23); }
  77% { left: 85%; opacity: 0.28; transform: translate(-50%,-50%) scale(1.05); animation-timing-function: cubic-bezier(.3,.02,.8,.7); }
  91% { left: 85%; opacity: 0.73; transform: translate(-50%,-50%) scale(0.65); animation-timing-function: cubic-bezier(.14,.65,.45,1); }
  96% { left: 87%; opacity: 0.66; transform: translate(-50%,-50%) scale(0.72); animation-timing-function: cubic-bezier(.4,.05,.88,.78); }
  100% { left: 88%; opacity: 0.71; transform: translate(-50%,-50%) scale(0.67); }
}
@keyframes basket-shadow-miss {
  0%, 8% { left: var(--goose-dribble-x); opacity: 0.52; transform: translate(-50%,-50%) scale(0.84); }
  13% { left: calc(var(--goose-dribble-x) - 3%); opacity: 0.73; transform: translate(-50%,-50%) scale(0.65); animation-timing-function: cubic-bezier(.18,.56,.54,1); }
  20% { left: calc(var(--goose-dribble-x) - 8%); opacity: 0.48; transform: translate(-50%,-50%) scale(0.87); animation-timing-function: cubic-bezier(.22,.65,.55,1); }
  25% { left: calc(var(--goose-dribble-x) - 4%); opacity: 0.36; transform: translate(-50%,-50%) scale(0.98); }
  27% { left: calc(var(--goose-dribble-x) - 4%); opacity: 0.36; transform: translate(-50%,-50%) scale(0.98); animation-timing-function: cubic-bezier(.35,0,.75,1); }
  30% { left: var(--goose-dribble-x); opacity: 0.47; transform: translate(-50%,-50%) scale(0.88); animation-timing-function: cubic-bezier(.2,.65,.48,1); }
  32% { left: calc(var(--goose-release-x) - 2%); opacity: .40; transform: translate(-50%,-50%) scale(.94); }
  34% { left: var(--goose-release-x); opacity: 0.34; transform: translate(-50%,-50%) scale(0.99); animation-timing-function: cubic-bezier(.2,.55,.6,1); }
  37% { left: calc(var(--goose-release-x) + 2%); opacity: .27; transform: translate(-50%,-50%) scale(1.05); }
  41% { left: 32%; opacity: .20; transform: translate(-50%,-50%) scale(1.12); }
  45% { left: 35%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.15); }
  58% { left: 54%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.27); }
  68% { left: 69%; opacity: 0.16; transform: translate(-50%,-50%) scale(1.22); }
  77% { left: 78%; opacity: 0.28; transform: translate(-50%,-50%) scale(1.05); animation-timing-function: cubic-bezier(.3,.02,.8,.7); }
  85% { left: 69%; opacity: 0.19; transform: translate(-50%,-50%) scale(1.12); animation-timing-function: cubic-bezier(.32,.05,.8,.68); }
  94% { left: 55%; opacity: 0.54; transform: translate(-50%,-50%) scale(0.82); }
  100% { left: 49%; opacity: 0.73; transform: translate(-50%,-50%) scale(0.65); }
}

