.racket-anatomy {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(240px, 0.85fr);
  gap: 1.25rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, rgba(8, 18, 35, 0.96), rgba(11, 31, 51, 0.94)),
    #0b1f33;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.racket-anatomy__connector {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.racket-anatomy__connector-line {
  stroke: #67e8f9;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: var(--connector-length, 0);
  stroke-dashoffset: var(--connector-length, 0);
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.42));
  opacity: 0;
  transition: stroke-dashoffset 220ms ease, opacity 160ms ease;
}

.racket-anatomy.has-connector .racket-anatomy__connector-line {
  stroke-dashoffset: 0;
  opacity: 0.92;
}

.racket-anatomy--light {
  border-color: rgba(148, 163, 184, 0.38);
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0.75rem 2rem rgba(15, 23, 42, 0.08);
}

.racket-anatomy--light .racket-anatomy__stage {
  border-radius: 0.5rem;
  background: #ffffff;
}

.racket-anatomy--light .racket-anatomy__connector-line {
  stroke: #0f766e;
  filter: drop-shadow(0 0 5px rgba(15, 118, 110, 0.22));
}

.racket-anatomy__stage {
  position: relative;
  max-width: 355px;
  width: min(100%, 355px);
  margin: 0 auto;
  aspect-ratio: var(--racket-stage-aspect-ratio, 710 / 1396);
}

.racket-anatomy__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.racket-anatomy__hotspot {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #e0f2fe;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
  transform: translate(-50%, -50%);
  transition: filter 160ms ease;
}

.racket-anatomy__hotspot:hover,
.racket-anatomy__hotspot:focus,
.racket-anatomy__hotspot.is-active {
  color: #082f49;
  filter: drop-shadow(0 0.5rem 0.7rem rgba(103, 232, 249, 0.28));
}

.racket-anatomy__hotspot:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 3px;
}

.racket-anatomy__dot {
  position: relative;
  z-index: 2;
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 0.8rem;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.28);
}

.racket-anatomy__dot::before,
.racket-anatomy__dot::after {
  position: absolute;
  inset: -0.45rem;
  z-index: -1;
  border-radius: inherit;
  content: "";
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 160ms ease, transform 160ms ease;
}

.racket-anatomy__dot::before {
  background: rgba(103, 232, 249, 0.28);
}

.racket-anatomy__dot::after {
  border: 2px solid rgba(103, 232, 249, 0.76);
  box-shadow: 0 0 1.2rem rgba(103, 232, 249, 0.58);
}

.racket-anatomy__hotspot.is-active .racket-anatomy__dot {
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.45),
    0 0 0.9rem rgba(103, 232, 249, 0.78);
}

.racket-anatomy__hotspot.is-active .racket-anatomy__dot::before,
.racket-anatomy__hotspot.is-active .racket-anatomy__dot::after {
  opacity: 1;
  transform: scale(1);
}

.racket-anatomy__label {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  max-width: 7.5rem;
  min-height: 2rem;
  padding: 0.45rem 0.58rem 0.45rem 1.45rem;
  border: 1px solid rgba(125, 211, 252, 0.72);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(7, 20, 38, 0.86);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.35);
  transform: translate(-0.82rem, -50%);
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.racket-anatomy__hotspot:hover .racket-anatomy__label,
.racket-anatomy__hotspot:focus .racket-anatomy__label,
.racket-anatomy__hotspot.is-active .racket-anatomy__label {
  border-color: #67e8f9;
  color: #082f49;
  background: #e0faff;
  box-shadow: 0 0.5rem 1.2rem rgba(103, 232, 249, 0.28);
}

.racket-anatomy__panel {
  position: relative;
  z-index: 3;
  padding: 1rem;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 0.75rem;
  color: #dbeafe;
  background: rgba(5, 14, 28, 0.82);
}

.racket-anatomy__panel-close {
  display: none;
}

.racket-anatomy__tip {
  color: #b6e66d;
}

.racket-anatomy__panel .text-secondary {
  color: #93c5fd !important;
}

.racket-anatomy--light .racket-anatomy__hotspot {
  color: #134e4a;
  background: transparent;
}

.racket-anatomy--light .racket-anatomy__hotspot:hover,
.racket-anatomy--light .racket-anatomy__hotspot:focus,
.racket-anatomy--light .racket-anatomy__hotspot.is-active {
  color: #ffffff;
  filter: drop-shadow(0 0.5rem 0.7rem rgba(15, 118, 110, 0.22));
}

.racket-anatomy--light .racket-anatomy__dot {
  border-color: rgba(255, 255, 255, 0.96);
  background: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.24);
}

.racket-anatomy--light .racket-anatomy__dot::before {
  background: rgba(13, 148, 136, 0.22);
}

.racket-anatomy--light .racket-anatomy__dot::after {
  border-color: rgba(13, 148, 136, 0.72);
  box-shadow: 0 0 1.2rem rgba(13, 148, 136, 0.38);
}

.racket-anatomy--light .racket-anatomy__hotspot.is-active .racket-anatomy__dot {
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(20, 184, 166, 0.36),
    0 0 0.9rem rgba(13, 148, 136, 0.48);
}

.racket-anatomy--light .racket-anatomy__label {
  border-color: rgba(15, 118, 110, 0.42);
  color: #134e4a;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.16);
}

.racket-anatomy--light .racket-anatomy__hotspot:hover .racket-anatomy__label,
.racket-anatomy--light .racket-anatomy__hotspot:focus .racket-anatomy__label,
.racket-anatomy--light .racket-anatomy__hotspot.is-active .racket-anatomy__label {
  border-color: #0f766e;
  color: #ffffff;
  background: #0f766e;
  box-shadow: 0 0.5rem 1.2rem rgba(15, 118, 110, 0.22);
}

.racket-anatomy--light .racket-anatomy__panel {
  border-color: rgba(15, 118, 110, 0.16);
  color: #172033;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0.45rem 1.4rem rgba(15, 23, 42, 0.08);
}

.racket-anatomy--light .racket-anatomy__tip {
  color: #0f766e;
}

.racket-anatomy--light .racket-anatomy__panel .text-secondary {
  color: #64748b !important;
}

@media (max-width: 767.98px) {
  .racket-anatomy {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    min-height: var(--racket-tool-mobile-min-height, auto);
  }

  .racket-anatomy__connector {
    display: none;
  }

  .racket-anatomy__stage {
    max-width: 285px;
  }

  .racket-anatomy__hotspot {
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    font-size: 0.68rem;
  }

  .racket-anatomy__panel {
    position: absolute;
    top: var(--racket-panel-top, 1rem);
    left: var(--racket-panel-left, 50%);
    z-index: 4;
    width: min(17.5rem, calc(100% - 1.5rem));
    padding: 0.85rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.42);
    transform: translateX(-50%);
  }

  .racket-anatomy.is-panel-hidden .racket-anatomy__panel {
    display: none;
  }

  .racket-anatomy__panel-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    min-height: 1.7rem;
    padding: 0;
    border: 1px solid rgba(219, 234, 254, 0.36);
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.58);
    font-size: 1.2rem;
    line-height: 1;
  }

  .racket-anatomy__panel-close:hover,
  .racket-anatomy__panel-close:focus {
    color: #082f49;
    background: #e0faff;
  }

  .racket-anatomy--light .racket-anatomy__panel-close {
    border-color: rgba(15, 118, 110, 0.24);
    color: #134e4a;
    background: rgba(255, 255, 255, 0.78);
  }

  .racket-anatomy--light .racket-anatomy__panel-close:hover,
  .racket-anatomy--light .racket-anatomy__panel-close:focus {
    color: #ffffff;
    background: #0f766e;
  }

  .racket-anatomy__panel h3 {
    padding-right: 2rem;
    font-size: 1rem;
  }

  .racket-anatomy__panel p {
    font-size: 0.88rem;
    line-height: 1.38;
  }

  .racket-anatomy__hotspot .racket-anatomy__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .racket-anatomy__hotspot,
  .racket-anatomy__dot::before,
  .racket-anatomy__dot::after {
    transition: none;
  }
}
