.gy-explanation {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(199, 0, 0, .72);
  text-underline-offset: .22em;
  cursor: help;
}

.gy-explanation::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.18em;
  height: 1.18em;
  margin-inline-start: .28em;
  color: #fff;
  font-size: .72em;
  font-weight: 750;
  line-height: 1;
  content: '?';
  vertical-align: .14em;
  background: #c70000;
  border-radius: 50%;
}

.gy-explanation:hover,
.gy-explanation:focus-visible {
  color: #a80000;
  text-decoration-color: #a80000;
}

.gy-explanation:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(199, 0, 0, .16);
  outline-offset: 3px;
}

.gy-explanation-modal[hidden] {
  display: none;
}

.gy-explanation-modal {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 20px;
  background: rgba(17, 24, 39, .48);
  backdrop-filter: blur(2px);
}

.gy-explanation-modal__window {
  box-sizing: border-box;
  width: min(560px, 100%);
  max-height: min(78vh, 680px);
  overflow: auto;
  color: #202124;
  background: #fff;
  border-top: 4px solid #c70000;
  border-radius: 15px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .30);
}

.gy-explanation-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 12px;
}

.gy-explanation-modal__head h2 {
  margin: 0;
  color: #171717;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 750;
  line-height: 1.25;
}

.gy-explanation-modal__close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #4b4f54;
  font: 400 29px/34px Arial, sans-serif;
  background: #f1f2f3;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.gy-explanation-modal__close:hover,
.gy-explanation-modal__close:focus-visible {
  color: #fff;
  background: #c70000;
  outline: none;
}

.gy-explanation-modal__text {
  padding: 4px 22px 24px;
  color: #32363a;
  font-size: 1.05rem;
  line-height: 1.65;
  white-space: pre-line;
}

.gy-explanation-is-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .gy-explanation-modal {
    align-items: end;
    padding: 12px;
  }

  .gy-explanation-modal__window {
    width: 100%;
    max-height: 82vh;
    border-radius: 14px;
  }

  .gy-explanation-modal__head {
    padding: 18px 18px 10px;
  }

  .gy-explanation-modal__text {
    padding: 4px 18px 21px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gy-explanation-modal:not([hidden]) .gy-explanation-modal__window {
    animation: gy-explanation-in .18s ease-out both;
  }

  @keyframes gy-explanation-in {
    from {
      opacity: 0;
      transform: translateY(10px) scale(.985);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}
