.main-goals-preview,
.gold-badge-effect-host {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  pointer-events: none;
  flex-shrink: 0;
}

.gold-badge-effect-host::before,
.gold-badge-effect-host::after {
  content: "";
  position: absolute;
  inset: -1.25rem;
  z-index: -1;
  border-radius: 999rem;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.36) rotate(-8deg);
}

.gold-badge-effect-host::before {
  background:
    radial-gradient(circle at 4% 46%, rgba(255, 242, 166, 0.98) 0 0.085rem, transparent 0.105rem),
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.9) 0 0.075rem, transparent 0.095rem),
    radial-gradient(circle at 30% 92%, rgba(245, 184, 39, 0.9) 0 0.08rem, transparent 0.1rem),
    radial-gradient(circle at 58% -4%, rgba(255, 235, 137, 0.95) 0 0.085rem, transparent 0.105rem),
    radial-gradient(circle at 94% 32%, rgba(255, 255, 255, 0.86) 0 0.075rem, transparent 0.095rem),
    radial-gradient(circle at 84% 96%, rgba(230, 147, 22, 0.82) 0 0.08rem, transparent 0.1rem);
  animation: main-goals-gold-sparks 1.35s ease-out 0.08s both;
}

.gold-badge-effect-host::after {
  inset: -1.55rem;
  background:
    radial-gradient(circle at -2% 16%, rgba(255, 255, 255, 0.92) 0 0.07rem, transparent 0.09rem),
    radial-gradient(circle at 18% 108%, rgba(255, 219, 91, 0.9) 0 0.08rem, transparent 0.105rem),
    radial-gradient(circle at 50% -12%, rgba(255, 241, 169, 0.95) 0 0.076rem, transparent 0.098rem),
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.78) 0 0.07rem, transparent 0.09rem),
    radial-gradient(circle at 106% 70%, rgba(240, 174, 35, 0.86) 0 0.08rem, transparent 0.105rem),
    radial-gradient(circle at 60% 118%, rgba(255, 233, 126, 0.86) 0 0.076rem, transparent 0.098rem);
  animation: main-goals-gold-sparks 1.55s ease-out 0.18s both;
}

.card-sub--roster {
  display: flex;
  align-items: flex-start;
  opacity: 1;
  color: rgba(248, 250, 252, 0.75);
}

.card-sub--roster .start-roster-list {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 6px;
}

.card-sub--roster .start-roster-list > * {
  flex: 0 0 auto;
}

.card-sub--roster .start-roster-chip:not(.quag-gold-badge) {
  opacity: 0.75;
}

/* Компактные бейджи hero-карточек держим одной геометрией независимо от их типа и состояния. */
.start-hero {
  --main-hero-badge-height: 1.5rem;
}

.start-hero .start-roster-chip,
.start-hero .main-goals-preview__button,
.start-hero--team-last .card-header-actions > .card-link[href*="#team-answer-poll-"] {
  box-sizing: border-box;
  height: var(--main-hero-badge-height);
  padding: 0 0.5rem;
}

.start-hero .start-roster-chip {
  font-weight: 700;
  white-space: nowrap;
}

.main-goals-preview__button {
  max-width: 100%;
  gap: 0.32rem;
  font-size: 0.78rem;
  line-height: 1.05;
  cursor: pointer;
  pointer-events: auto;
}

/* Бейдж опроса остаётся крайним справа, чтобы ленивое появление/отсутствие достижений не сдвигало его. */
.start-hero--team-last .card-header-actions > [data-goals-preview-container] {
  order: 1;
}

.start-hero--team-last .card-header-actions > .card-link[href*="#team-answer-poll-"] {
  order: 2;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border: 0.0625rem solid #bae6fd;
  border-radius: 999rem;
  background: #38bdf8;
  color: #082f49;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
}

.start-hero--team-last .card-header-actions > .card-link[href*="#team-answer-poll-"]:hover,
.start-hero--team-last .card-header-actions > .card-link[href*="#team-answer-poll-"]:focus-visible {
  background: #7dd3fc;
  color: #082f49;
  text-decoration: none;
}

.start-hero--team-last .card-header-actions > .card-link[href*="#team-answer-poll-"]:focus-visible {
  outline: 0.125rem solid #e0f2fe;
  outline-offset: 0.125rem;
}

.gold-badge-effect-host .quag-gold-badge {
  pointer-events: auto;
}

.main-goals-preview__text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(0.035rem);
}


.offcanvas.gold-insight-offcanvas {
  --bs-offcanvas-height: min(88dvh, 44rem);
  height: min(88dvh, 44rem);
  max-height: calc(100dvh - 0.75rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1f2a44;
}

.gold-insight-offcanvas .offcanvas-header {
  flex: 0 0 auto;
  padding: 0.85rem 1rem 0.72rem;
  border-bottom: 0.0625rem solid rgba(202, 213, 229, 0.72);
  background: linear-gradient(180deg, #fffdf8 0%, #f8fbff 100%);
}

.gold-insight-offcanvas .offcanvas-title {
  font-size: clamp(1.08rem, 1.45vw, 1.32rem);
  line-height: 1.22;
  font-weight: 800;
  color: #17233a;
}

.gold-insight-offcanvas .btn-close {
  opacity: 0.82;
}

.offcanvas.gold-insight-offcanvas > .offcanvas-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 48%, #fffaf0 100%);
}

.gold-insight-grid,
.future-goals-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0;
}

.gold-insight-card,
.future-goal-card {
  position: relative;
  border: 0;
  border-top: 0.125rem solid rgba(176, 190, 212, 0.72);
  border-radius: 0;
  background: #fff8e2;
  box-shadow: none;
  padding: 0.88rem 1rem 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 0.66rem;
}

.gold-insight-card::before,
.future-goal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.22rem;
  background: rgba(204, 153, 43, 0.72);
}

.gold-insight-card + .gold-insight-card,
.future-goal-card + .future-goal-card {
  border-top-color: rgba(142, 159, 188, 0.78);
}

.gold-insight-grid > .gold-insight-card:nth-child(even),
.future-goals-grid > .future-goal-card:nth-child(even) {
  background: #eef6ff;
}

.gold-insight-grid > .gold-insight-card:nth-child(even)::before,
.future-goals-grid > .future-goal-card:nth-child(even)::before {
  background: rgba(83, 139, 225, 0.7);
}

.gold-insight-card__header,
.future-goal-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.gold-insight-card__type,
.future-goal-card__type {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  width: fit-content;
  padding: 0;
  font-size: 0.74rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: #80580c;
  background: transparent;
}

.gold-insight-card__title,
.future-goal-card__title {
  font-size: clamp(1.03rem, 1.2vw, 1.16rem);
  line-height: 1.3;
  font-weight: 800;
  color: #17233a;
}

.gold-insight-card__description,
.future-goal-card__description {
  margin-top: 0;
  font-size: 0.93rem;
  line-height: 1.42;
  color: #52627a;
}

.gold-insight-card__divider,
.future-goal-card__divider {
  border-top: 0.0625rem dashed rgba(157, 174, 201, 0.72);
  margin: 0;
}

.gold-insight-card__section,
.future-goal-card__section {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.gold-insight-card__section-title,
.future-goal-card__section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.12;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: #24508f;
  background: transparent;
  margin-bottom: 0;
}

.gold-insight-card__section-title::before,
.future-goal-card__section-title::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999rem;
  background: #78a9ff;
  box-shadow: 0 0 0 0.18rem rgba(120, 169, 255, 0.16);
  flex: 0 0 auto;
}

.gold-insight-card__status,
.future-goal-card__status,
.gold-insight-card__plan,
.future-goal-card__plan {
  border-left: 0.14rem solid rgba(120, 169, 255, 0.72);
  border-radius: 0;
  background: transparent;
  color: #243b5a;
  font-size: 0.96rem;
  line-height: 1.48;
  box-shadow: none;
}

.gold-insight-card__status,
.future-goal-card__status {
  padding: 0 0 0 0.56rem;
}

.gold-insight-card__plan,
.future-goal-card__plan {
  margin: 0;
  padding: 0 0 0 0.56rem;
}

@media (min-width: 768px) {
  .offcanvas.gold-insight-offcanvas {
    left: 50%;
    right: auto;
    width: min(92vw, 56rem);
    margin-inline: auto;
    border-top-left-radius: 1.1rem;
    border-top-right-radius: 1.1rem;
    transform: translate(-50%, 100%);
  }

  .offcanvas.gold-insight-offcanvas.show:not(.hiding),
  .offcanvas.gold-insight-offcanvas.showing {
    transform: translate(-50%, 0);
  }

  .offcanvas.gold-insight-offcanvas.hiding {
    transform: translate(-50%, 100%);
  }

  .gold-insight-grid,
  .future-goals-grid {
    gap: 0.75rem;
  }

  .future-goals-grid.goals-count-1 {
    grid-template-columns: minmax(20rem, 35rem);
    justify-content: center;
  }

  .future-goals-grid.goals-count-2,
  .future-goals-grid.goals-count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .future-goals-grid.goals-count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@keyframes main-goals-gold-sparks {
  0% {
    opacity: 0;
    transform: scale(0.32) rotate(-10deg);
    filter: blur(0.045rem);
  }
  24% {
    opacity: 1;
  }
  68% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: scale(1.95) rotate(10deg);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gold-badge-effect-host::before,
  .gold-badge-effect-host::after {
    animation: none;
  }
}
