/* Per-link frames use only server-validated selectors and custom properties. */
.link-frame {
  display: var(--link-frame-display, block);
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}
.frame-gallery {
  --link-frame-color: #c6a453;
  --link-frame-width: 2px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.frame-gallery .frame-swatch {
  position: relative;
  isolation: isolate;
  display: grid;
  min-width: 0;
  min-height: 4.5rem;
  place-items: center;
  padding: 0.8rem 1rem;
  color: var(--editor-ink);
  background: var(--editor-bg);
  border: 2px solid var(--link-frame-color);
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}
.frame-swatch > span:not(.link-frame) {
  position: relative;
  z-index: 3;
  pointer-events: none;
}
.frame-gallery .link-frame--double {
  border-style: double;
  border-width: 4px;
}
.frame-swatch[aria-pressed="true"] {
  outline: 2px solid var(--editor-primary);
  outline-offset: 4px;
}
.frame-gallery-details {
  margin-top: 1.25rem;
}
.frame-gallery-details summary {
  cursor: pointer;
  color: var(--editor-primary);
  font-weight: 600;
  font-size: 0.85rem;
}
.public-page {
  --link-frame-color: #c6a453;
  --link-frame-width: 2px;
}
.public-page [class*="link-frame--"] {
  isolation: isolate;
}
.public-page .profile-link[class*="link-frame--"]::before,
.public-page .profile-link[class*="link-frame--"]::after {
  display: none;
}
.public-page .link-frame--none {
  border: 0 !important;
}
.public-page .link-frame--none .link-frame {
  display: none;
}
.public-page
  :is(
    .link-frame--line,
    .link-frame--double,
    .link-frame--runic,
    .link-frame--tread,
    .link-frame--botanical,
    .link-frame--circuit
  ) {
  border: var(--link-frame-width) solid var(--link-frame-color) !important;
}
.public-page .link-frame--double {
  border-style: double !important;
  border-width: calc(var(--link-frame-width) * 2) !important;
}
.link-frame--runic {
  border-radius: 5px 16px !important;
  overflow: visible !important;
}
.link-frame--runic .link-frame {
  inset: 4px;
  border: 1px solid var(--link-frame-color);
  border-radius: 2px 12px;
  opacity: 0.85;
}
.link-frame--runic .link-frame::before,
.link-frame--runic .link-frame::after {
  position: absolute;
  width: 12px;
  height: 12px;
  content: "";
  background: var(--link-frame-color);
  clip-path: polygon(
    50% 0,
    65% 35%,
    100% 50%,
    65% 65%,
    50% 100%,
    35% 65%,
    0 50%,
    35% 35%
  );
}
.link-frame--runic .link-frame::before {
  top: -10px;
  left: 8%;
}
.link-frame--runic .link-frame::after {
  right: 8%;
  bottom: -10px;
}
.link-frame--runic .link-frame,
.theme-gilded-character
  .profile-link:not([class*="link-frame--"]):not(.vcard-card)
  .link-frame {
  inset: -3px;
  background: var(--link-frame-color, #bd9b42);
  border: 0;
  border-radius: 0;
  mask: url("../images/frame-runic.svg") center/100% 100% no-repeat;
  opacity: 1;
}
.link-frame--tread .link-frame {
  inset: 3px;
  border-inline: 7px solid transparent;
  border-image: repeating-linear-gradient(
      145deg,
      var(--link-frame-color) 0 4px,
      transparent 4px 8px
    )
    8;
}
.link-frame--tread .profile-link__content {
  padding-inline: 8px;
}
.link-frame--botanical {
  border-radius: 22px 5px !important;
}
.link-frame--botanical .link-frame {
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--link-frame-color) 55%, transparent);
  border-radius: 18px 3px;
  background:
    radial-gradient(
      ellipse at 0 100%,
      var(--link-frame-color) 0 3px,
      transparent 4px
    ),
    radial-gradient(
      ellipse at 100% 0,
      var(--link-frame-color) 0 3px,
      transparent 4px
    );
}
.link-frame--circuit .link-frame {
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--link-frame-color) 55%, transparent);
  clip-path: polygon(
    0 0,
    25% 0,
    25% 10%,
    75% 10%,
    75% 0,
    100% 0,
    100% 100%,
    75% 100%,
    75% 90%,
    25% 90%,
    25% 100%,
    0 100%
  );
}
.link-frame--botanical .link-frame {
  background: var(--link-frame-color);
  border: 0;
  border-radius: 0;
  mask: url("../images/frame-botanical.svg") center/100% 100% no-repeat;
}
.link-frame--circuit .link-frame {
  background: var(--link-frame-color);
  border: 0;
  clip-path: none;
  mask: url("../images/frame-circuit.svg") center/100% 100% no-repeat;
}
/* Nine additional, independently authored geometries; no theme dependencies. */
.public-page
  :is(
    .link-frame--deco,
    .link-frame--fjord,
    .link-frame--aurora,
    .link-frame--orbital,
    .link-frame--signal,
    .link-frame--carbon,
    .link-frame--atlas,
    .link-frame--shard,
    .link-frame--ribbon
  ) {
  border: var(--link-frame-width) solid var(--link-frame-color) !important;
}
:is(
    .link-frame--deco,
    .link-frame--fjord,
    .link-frame--orbital,
    .link-frame--signal,
    .link-frame--atlas,
    .link-frame--shard
  )
  .link-frame {
  inset: 3px;
  background: var(--link-frame-color);
  border-radius: 0;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}
.link-frame--deco {
  border-radius: 3px !important;
}
.link-frame--deco .link-frame {
  mask-image: url("../images/frame-deco.svg");
}
.link-frame--fjord {
  border-radius: 26px 12px 28px 8px !important;
}
.link-frame--fjord .link-frame {
  mask-image: url("../images/frame-fjord.svg");
}
.link-frame--orbital {
  border-radius: 999px !important;
  padding-inline: 1.9rem;
}
.link-frame--orbital .link-frame {
  mask-image: url("../images/frame-orbital.svg");
}
.link-frame--signal {
  border-radius: 3px !important;
}
.link-frame--signal .link-frame {
  mask-image: url("../images/frame-signal.svg");
}
.link-frame--atlas {
  border-radius: 12px !important;
  padding-inline: 1.8rem;
}
.link-frame--atlas .link-frame {
  mask-image: url("../images/frame-atlas.svg");
  opacity: 0.9;
}
.link-frame--shard {
  border-radius: 0 20px 0 18px !important;
}
.link-frame--shard .link-frame {
  mask-image: url("../images/frame-shard.svg");
}
.link-frame--aurora {
  border-radius: 18px !important;
  box-shadow: 0 0 14px
    color-mix(in srgb, var(--link-frame-color) 20%, transparent) !important;
}
.link-frame--aurora .link-frame {
  inset: 3px;
  border: 1px solid color-mix(in srgb, var(--link-frame-color) 40%, white);
  background:
    linear-gradient(
        110deg,
        transparent,
        var(--link-frame-color),
        #b6b2ff,
        transparent
      )
      top/100% 2px no-repeat,
    linear-gradient(
        110deg,
        transparent,
        #f5b6ed,
        var(--link-frame-color),
        transparent
      )
      bottom/100% 2px no-repeat;
  box-shadow: inset 0 0 14px
    color-mix(in srgb, var(--link-frame-color) 10%, transparent);
}
.link-frame--carbon {
  border-radius: 9px !important;
}
.link-frame--carbon .link-frame {
  inset: 3px;
  border: 1px solid color-mix(in srgb, var(--link-frame-color) 40%, transparent);
  background:
    repeating-linear-gradient(
        45deg,
        var(--link-frame-color) 0 2px,
        transparent 2px 5px
      )
      left/8px 100% no-repeat,
    repeating-linear-gradient(
        -45deg,
        var(--link-frame-color) 0 2px,
        transparent 2px 5px
      )
      right/8px 100% no-repeat;
  opacity: 0.8;
}
.link-frame--carbon .link-frame::before,
.link-frame--carbon .link-frame::after {
  position: absolute;
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border: 1px solid var(--link-frame-color);
  border-radius: 50%;
  background: #14171b;
  content: "";
}
.link-frame--carbon .link-frame::before {
  left: 11px;
}
.link-frame--carbon .link-frame::after {
  right: 11px;
}
.link-frame--ribbon {
  border-radius: 2px !important;
}
.link-frame--ribbon .link-frame {
  inset: 4px 12px;
  border-block: 1px solid
    color-mix(in srgb, var(--link-frame-color) 65%, transparent);
  border-radius: 0;
}
.link-frame--ribbon .link-frame::before,
.link-frame--ribbon .link-frame::after {
  position: absolute;
  width: 20px;
  height: 20px;
  background: linear-gradient(
    135deg,
    var(--link-frame-color) 48%,
    color-mix(in srgb, var(--link-frame-color) 48%, #10141a) 49% 80%,
    transparent 81%
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  content: "";
}
.link-frame--ribbon .link-frame::before {
  left: -10px;
  top: -3px;
  transform: rotate(-90deg);
}
.link-frame--ribbon .link-frame::after {
  right: -10px;
  bottom: -3px;
  transform: rotate(90deg);
}

.public-page
  :is(
    .link-frame--rally-car,
    .link-frame--hud,
    .link-frame--prism,
    .link-frame--svea,
    .link-frame--boreal
  ) {
  border: var(--link-frame-width) solid var(--link-frame-color) !important;
}
:is(
    .link-frame--rally-car,
    .link-frame--hud,
    .link-frame--svea,
    .link-frame--boreal
  )
  .link-frame {
  inset: 3px;
  background: var(--link-frame-color);
  border-radius: 0;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}
.link-frame--rally-car {
  border-radius: 2px 19px 2px 17px !important;
}
.link-frame--rally-car .link-frame {
  mask-image: url("../images/frame-rally-car.svg");
}
.link-frame--hud {
  border-radius: 18px 3px !important;
}
.link-frame--hud .link-frame {
  mask-image: url("../images/frame-hud.svg");
  filter: drop-shadow(
    0 0 2px color-mix(in srgb, var(--link-frame-color) 45%, transparent)
  );
}
.link-frame--prism {
  border-radius: 14px !important;
  box-shadow: 0 3px 18px
    color-mix(in srgb, var(--link-frame-color) 18%, transparent) !important;
}
.link-frame--prism .link-frame {
  inset: 3px;
  padding: 2px;
  background: linear-gradient(
    105deg,
    var(--link-frame-color),
    #7c6cff,
    #ed7bcb,
    #58d6bd,
    var(--link-frame-color)
  );
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.link-frame--svea {
  border-radius: 22px 8px !important;
}
.link-frame--svea .link-frame {
  mask-image: url("../images/frame-svea.svg");
}
.link-frame--boreal {
  border-radius: 8px 24px !important;
}
.link-frame--boreal .link-frame {
  mask-image: url("../images/frame-boreal.svg");
}

.theme-gilded-character {
  background:
    radial-gradient(ellipse at 50% 15%, #71364155, transparent 65%),
    repeating-linear-gradient(115deg, #bd9b4208 0 1px, transparent 1px 36px),
    #231a24;
}
.theme-gilded-character .profile-header {
  color: #f8edcf;
}
.theme-gilded-character .profile-subtitle {
  color: #cdbd98;
}
.theme-gilded-character .profile-avatar {
  border: 3px double #d8b85c;
  box-shadow: 0 0 0 7px #b38c2629;
}
.theme-gilded-character .profile-link:not(.vcard-card) {
  border: 2px solid #bd9b42;
  border-radius: 5px 18px;
  background-image: radial-gradient(ellipse at top, #fffdf8, #eee4ca);
  box-shadow:
    inset 0 0 0 4px #fbf6e8,
    inset 0 0 0 5px #c4a852,
    0 5px 0 #09040d55;
  padding: 1.45rem 1.65rem;
}
.theme-gilded-character .profile-link__title {
  font-family: Georgia, serif;
  letter-spacing: 0.025em;
}
.theme-gilded-character .profile-section__title {
  font-family: Georgia, serif;
  color: #e4c569;
}
.theme-gilded-character .profile-section {
  border: 1px solid #b38c2655;
  background: #f0dcbd06;
}
.theme-dragon-forge {
  background:
    radial-gradient(ellipse at 15% 0, #9e3c263b, transparent 48%),
    radial-gradient(ellipse at 100% 70%, #c4781d1a, transparent 40%),
    repeating-conic-gradient(
      from 30deg,
      #9b694008 0 60deg,
      transparent 60deg 120deg
    ),
    #120f13;
  background-size:
    auto,
    auto,
    70px 120px,
    auto;
}
.theme-dragon-forge .profile-header::after {
  display: block;
  content: "◆  ·  ᚠ  ·  ◆";
  font-size: 1.2rem;
  letter-spacing: 0.7rem;
  color: #ed9d47;
  margin-top: 1.25rem;
}
.theme-dragon-forge .profile-header {
  position: relative;
  isolation: isolate;
}
.theme-dragon-forge .profile-header::before {
  position: absolute;
  inset: 0 auto auto 50%;
  transform: translateX(-50%) rotate(-12deg);
  width: 18rem;
  height: 18rem;
  background: #ed9d47;
  mask: url("../images/d20.svg") center/contain no-repeat;
  opacity: 0.11;
  content: "";
  z-index: -1;
  pointer-events: none;
}
.theme-dragon-forge .profile-link:not(.vcard-card) {
  background: linear-gradient(120deg, #2d2027, #1a171f);
  border: 1px solid #80523b;
  box-shadow:
    inset 3px 0 #ed9d47,
    0 0.4rem 1.5rem #0004;
}
.theme-dragon-forge .profile-link__title {
  font-family: Georgia, serif;
  letter-spacing: 0.025em;
}
.theme-dragon-forge .profile-section__title {
  color: #ed9d47;
  font-family: Georgia, serif;
}

/* Keep labels clear of foliage, contour marks and HUD rails at every width. */
.public-page
  .profile-link[class*="link-frame--"]:not(.link-frame--none):not(
    .link-frame--line
  ):not(.link-frame--double):not(.profile-link--image-only) {
  padding-inline: clamp(2.5rem, 12%, 5.5rem);
}
