.basketball-challenge {
  width: min(100%, 680px);
  color: #3d2461;
  --basketball-accent: #aa3c18;
  --basketball-orange: #ffb36d;
}

.basketball-hud, .basketball-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.basketball-hud { margin-bottom: .48rem; min-height: 36px; font-weight: 830; }
.basketball-round { padding-inline: .15rem; }
.basketball-conditions {
  padding: .24rem .5rem;
  border: 1px solid #edd2a6;
  border-radius: 8px;
  background: #fff3ce;
  color: #713518;
  font-size: .88rem;
}
.basketball-score { display: flex; gap: .38rem; padding: 0; margin: 0 0 0 auto; list-style: none; }
.basketball-score li {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #e7d7ee;
  border-radius: 50%;
  background: #faf1fc;
  font-size: .86rem;
  line-height: 1;
}
.basketball-score li[data-current] { border-color: #b24724; box-shadow: 0 0 0 3px #ffba8154; }
.basketball-score li[data-outcome="goal"] { border-color: #318561; background: #cbf9bf; color: #1e5837; }
.basketball-score li[data-outcome="goal"]::before { content: '✓'; }
.basketball-score li[data-outcome="short"], .basketball-score li[data-outcome="long"] { border-color: #b3734a; background: #ffe2cd; color: #7b351c; }
.basketball-score li[data-outcome="short"]::before, .basketball-score li[data-outcome="long"]::before { content: '×'; }

.basketball-court {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(208px, 55vw, 310px);
  border: 1px solid #7d5293;
  border-radius: 18px;
  background: linear-gradient(#251f56, #73458a 67%, #efac91);
  box-shadow: 0 5px 0 #54225220;
}
.basketball-stands {
  position: absolute;
  inset: 0 0 18%;
  background:
    radial-gradient(ellipse at 25% 0%, #feeac793, transparent 32%),
    radial-gradient(ellipse at 73% 0%, #ffd9fca0, transparent 32%),
    radial-gradient(circle, #ffd7a8 0 1px, transparent 2px) 2px 0 / 15px 13px,
    radial-gradient(circle, #e0b2ff 0 1.25px, transparent 2px) 7px 4px / 17px 16px,
    repeating-linear-gradient(0deg, #41265bd4 0 5px, #6b3b7a4d 6px 16px);
  opacity: .74;
}
.basketball-stands::before { position: absolute; inset: 0; content: ''; background: radial-gradient(ellipse at 50% 27%, #4c2f717a 0 18%, transparent 75%); }
.basketball-floor {
  position: absolute;
  inset: 73% -7% -8%;
  border-top: 3px solid #ffe2a8;
  background:
    repeating-linear-gradient(0deg, #913b1d34 0 1px, transparent 2px 10px),
    repeating-linear-gradient(94deg, transparent 0 10%, #a7543219 10% 12%),
    linear-gradient(#d77f49, #ffc27f);
  transform: perspective(250px) rotateX(24deg);
  box-shadow: 0 -6px 13px #53264d4d;
}
.basketball-floor::after {
  position: absolute;
  inset: 12% 17% -45%;
  content: '';
  border: 2px solid #fff4c4be;
  border-radius: 50%;
}
.basketball-distance-line {
  position: absolute;
  left: 10%;
  top: 88%;
  width: calc(var(--hoop-x) - 10%);
  height: 9px;
  border-inline: 2px solid #6e311e;
  border-top: 2px dashed #6e311ec4;
  opacity: .70;
}
.basketball-court::after {
  content: '';
  position: absolute;
  left: calc(var(--hoop-x) + 7%);
  top: calc(var(--hoop-y) - 4%);
  width: 2%;
  height: calc(84% - var(--hoop-y));
  border: 1px solid #b8abd5;
  border-radius: 2px;
  background: linear-gradient(90deg, #7a6096, #d1c9e1 64%, #594573);
}
.basketball-backboard {
  position: absolute;
  z-index: 1;
  left: calc(var(--hoop-x) + 3%);
  top: calc(var(--hoop-y) - 20%);
  width: 10.5%;
  height: 22%;
  border: 2px solid #f8e9fe;
  border-radius: 5px;
  background: linear-gradient(140deg, #fccdf69c, #aab9e5bf);
  box-shadow: inset 0 0 0 2px #9d80bd, 0 2px 0 #593567;
  transform: skewY(-9deg);
}
.basketball-backboard::before {
  position: absolute;
  content: '';
  inset: 35% 20% 15%;
  border: 1px solid #fff5f8;
  border-radius: 2px;
}
.basketball-rim {
  position: absolute;
  z-index: 3;
  left: var(--hoop-x);
  top: var(--hoop-y);
  width: var(--hoop-width, 8%);
  height: 5%;
  border: 2px solid #a72c23;
  border-radius: 65%;
  background: #ff6842;
  box-shadow: inset 0 0 0 1px #ffd293, 0 2px 2px #4e26416e;
  transform: translate(-50%, -50%);
}
.basketball-net {
  position: absolute;
  z-index: 2;
  left: var(--hoop-x);
  top: var(--hoop-y);
  width: var(--hoop-width, 8%);
  height: 17%;
  background: repeating-linear-gradient(56deg, transparent 0 4px, #fef0f4ad 5px 6px), repeating-linear-gradient(-56deg, transparent 0 4px, #fef0f4a1 5px 6px);
  clip-path: polygon(0 0, 100% 0, 72% 95%, 31% 95%);
  transform: translateX(-50%);
}
.basketball-arc { position: absolute; z-index: 2; inset: 0; }
.basketball-arc i {
  position: absolute;
  width: clamp(3px, 1vw, 5px);
  height: clamp(3px, 1vw, 5px);
  border-radius: 50%;
  background: #fff5a6d1;
  transform: translate(-50%, -50%);
}
.basketball-challenge[data-flight] .basketball-arc { visibility: hidden; }
.basketball-ball {
  position: absolute;
  z-index: 4;
  width: clamp(17px, 5.6vw, 37px);
  aspect-ratio: 1;
  border: 1px solid #873a2a;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 5% 37%, transparent 0 42%, #873b29 44% 47%, transparent 50%),
    radial-gradient(ellipse at 75% 89%, transparent 0 43%, #873b29 45% 48%, transparent 50%),
    linear-gradient(130deg, transparent 0 46%, #873b29 49% 52%, transparent 55%),
    radial-gradient(circle at 31% 27%, #ffe39a, #ffb45c 33%, #e86d31 71%, #b34724);
  box-shadow: 0 3px 7px #5020324f;
  transform: translate(-50%, -50%);
}
.basketball-challenge[data-charging] .basketball-ball { box-shadow: 0 0 15px #ffd781, 0 3px 7px #5020324f; }
.basketball-challenge[data-outcome="goal"] .basketball-rim { box-shadow: 0 0 15px 4px #ffd570; }

.basketball-power { display: flex; align-items: center; gap: .65rem; margin-top: .7rem; }
.basketball-strength {
  position: relative;
  flex: 1 1 auto;
  height: 17px;
  overflow: hidden;
  border: 1px solid #dbb4ce;
  border-radius: 99px;
  background: #f5eaf4;
}
.basketball-strength span { position: absolute; inset: 0 auto 0 0; width: var(--power, 0%); border-radius: inherit; background: linear-gradient(90deg, #ea723a, #ffb253); }
.basketball-strength[data-hint="true"]::after {
  position: absolute;
  inset: 0 auto 0 var(--target-min);
  width: calc(var(--target-max) - var(--target-min));
  border-inline: 2px solid #1e8164;
  content: '';
  background: #73d087bb;
}
.basketball-readout { min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 820; }
.basketball-status { min-height: 1.5em; margin: .53rem 0; line-height: 1.45; font-weight: 650; word-break: keep-all; }
.basketball-shoot, .basketball-mode { min-height: 46px; padding: .4rem .8rem; border: 1px solid; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 780; }
.basketball-shoot {
  min-width: 106px;
  border-color: #a54220;
  background: linear-gradient(#f47f48, #c24d2a);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffe0ab8c, 0 3px 0 #942f1c;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.basketball-mode { border-color: #d1b5da; color: #5f316f; background: #fff7fc; }
.basketball-shoot[aria-disabled="true"], .basketball-mode[aria-disabled="true"] { opacity: .7; cursor: default; }
.basketball-shoot:focus-visible, .basketball-mode:focus-visible, .basketball-range:focus-visible { outline: 3px solid #813b93; outline-offset: 2px; }
.basketball-slider { display: flex; flex: 1 0 100%; align-items: center; gap: .5rem; font-weight: 730; }
.basketball-slider[hidden] { display: none; }
.basketball-range { flex: 1 1 auto; min-width: 54px; min-height: 44px; accent-color: #ce4e30; }

.basketball-preview { width: 100%; pointer-events: none; }
.basketball-preview .basketball-court { height: clamp(98px, 17vw, 138px); border-radius: 12px; box-shadow: none; }
.basketball-preview .basketball-ball { width: clamp(11px, 3.4vw, 22px); }
.basketball-preview .basketball-rim { border-width: 1px; }
.basketball-preview .basketball-backboard { border-width: 1px; }
.basketball-preview .basketball-arc i { width: 3px; height: 3px; }
