/* Absolute overlay only: all existing card/image geometry and effects are retained. */
.secret-profile-badge {
  --profile-badge-edge: var(--profile-badge-color, #8f1522);
  --profile-badge-glow-rest: var(--profile-badge-color, #8f1522);
  --profile-badge-glow-peak: var(--profile-badge-color, #8f1522);
  --profile-badge-glow-halo: var(--profile-badge-color, #8f1522);
  --profile-badge-glow-noticeable: var(--profile-badge-color, #8f1522);
  --profile-badge-halo-noticeable: var(--profile-badge-color, #8f1522);
  --profile-badge-edge-peak: var(--profile-badge-color, #8f1522);
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  display: inline-block;
  box-sizing: border-box;
  max-width: calc(100% - 16px);
  padding: 7px 12px;
  border: 1px solid var(--profile-badge-edge);
  border-radius: 2px 2px 2px 9px;
  background: var(--profile-badge-color, #8f1522);
  color: var(--profile-badge-ink, #f4eee7);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5), 0 0 8px var(--profile-badge-glow-rest);
  font-family: var(--font-utility, Arial, sans-serif);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .11em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.secret-profile-badge[hidden] { display: none; }
[data-homepage-promotion-expires][hidden],
[data-homepage-featured][hidden],
[data-homepage-mobile-featured][hidden] { display: none; }

/* All colored edges and glow layers follow the saved custom background. */
@supports (color: color-mix(in srgb, black, white)) {
  .secret-profile-badge {
    --profile-badge-edge: color-mix(in srgb, var(--profile-badge-color, #8f1522) 65%, white);
    --profile-badge-glow-rest: color-mix(in srgb, var(--profile-badge-color, #8f1522) 35%, transparent);
    --profile-badge-glow-peak: color-mix(in srgb, var(--profile-badge-color, #8f1522) 80%, transparent);
    --profile-badge-glow-halo: color-mix(in srgb, var(--profile-badge-color, #8f1522) 40%, transparent);
    --profile-badge-glow-noticeable: color-mix(in srgb, var(--profile-badge-color, #8f1522) 95%, transparent);
    --profile-badge-halo-noticeable: color-mix(in srgb, var(--profile-badge-color, #8f1522) 60%, transparent);
    --profile-badge-edge-peak: color-mix(in srgb, var(--profile-badge-color, #8f1522) 40%, white);
  }
}

.homepage-featured-card > .secret-profile-badge { top: calc(9% - 3px); right: calc(9% - 3px); }
.homepage-mobile-card > .secret-profile-badge { top: calc(8% - 3px); right: calc(10% - 3px); }

.profile-gallery-main .secret-profile-badge { padding: 8px 13px; font-size: 14px; }

.secret-profile-badge--animated { animation: secret-profile-badge-breathe 2.3s ease-in-out infinite; }
.secret-profile-badge--animated.secret-profile-badge--noticeable { animation-name: secret-profile-badge-glow-noticeable; }

@keyframes secret-profile-badge-breathe {
  0%, 100% {
    box-shadow: 0 2px 5px rgba(0, 0, 0, .5), 0 0 8px var(--profile-badge-glow-rest);
  }
  50% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 0 12px var(--profile-badge-glow-peak), 0 0 18px var(--profile-badge-glow-halo);
  }
}

/* Fixed dimensions and typography: only outer light and border color animate. */
@keyframes secret-profile-badge-glow-noticeable {
  0%, 100% {
    border-color: var(--profile-badge-edge);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .5), 0 0 8px var(--profile-badge-glow-rest);
  }
  50% {
    border-color: var(--profile-badge-edge-peak);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .5), 0 0 18px var(--profile-badge-glow-noticeable), 0 0 30px var(--profile-badge-halo-noticeable);
  }
}

@media (max-width: 767px) {
  .secret-profile-badge {
    padding: 6px 9px;
    font-size: 12px;
    letter-spacing: .1em;
  }
  .profile-gallery-main .secret-profile-badge { padding: 6.5px 9px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .secret-profile-badge--animated,
  .secret-profile-badge--animated.secret-profile-badge--noticeable { animation: none; }
}

/* Rebuild Schedule thumbnails: retain the circular crop beneath a micro-tag. */
.schedule-page .schedule-avatar[data-profile-badge-thumbnail] {
  overflow: visible;
}

.schedule-page .schedule-avatar[data-profile-badge-thumbnail] > .schedule-avatar__image {
  display: grid;
  position: absolute;
  inset: 0;
  overflow: hidden;
  place-items: center;
  border-radius: inherit;
}

.schedule-page .schedule-avatar[data-profile-badge-thumbnail] > .secret-profile-badge {
  top: -2px;
  right: -3px;
  max-width: calc(100% + 4px);
  overflow: hidden;
  padding: 2px 4px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 3px var(--profile-badge-glow-rest);
}

@media (prefers-reduced-motion: no-preference) {
  .schedule-page .schedule-avatar[data-profile-badge-thumbnail] > .secret-profile-badge--animated {
    animation: secret-schedule-badge-breathe 2.8s ease-in-out infinite;
  }
  .schedule-page .schedule-avatar[data-profile-badge-thumbnail] > .secret-profile-badge--animated.secret-profile-badge--noticeable {
    animation: secret-schedule-badge-glow-noticeable 2.3s ease-in-out infinite;
  }
}

@keyframes secret-schedule-badge-breathe {
  0%, 100% {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 3px var(--profile-badge-glow-rest);
  }
  50% {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 6px var(--profile-badge-glow-peak);
  }
}

@keyframes secret-schedule-badge-glow-noticeable {
  0%, 100% {
    border-color: var(--profile-badge-edge);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 3px var(--profile-badge-glow-rest);
  }
  50% {
    border-color: var(--profile-badge-edge-peak);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 9px var(--profile-badge-glow-noticeable), 0 0 14px var(--profile-badge-halo-noticeable);
  }
}

@media (max-width: 680px) {
  .schedule-page .schedule-avatar[data-profile-badge-thumbnail] > .secret-profile-badge {
    font-size: 10px;
  }
}
