/* V1.28Beta: one continuous illustrated shell for opportunity, artifact, and landmark cards. */

:root {
  --shared-card-outer-frame: url("assets/ui/cards/shared-card-outer-frame-v2.webp?v=V1.28Beta-unified-card-shell2");
  --shared-card-description-base: url("assets/ui/cards/shared-card-description-base-v2.webp?v=V1.28Beta-unified-card-shell2");
  --shared-card-description-base-mobile: url("assets/ui/cards/shared-card-description-base-mobile-v2.webp?v=V1.28Beta-unified-card-shell2");
}

html body:not(.maintenance-mode) .opportunity-card {
  --unified-card-accent: #4f93b2;
  --unified-card-accent-soft: rgba(104, 177, 207, 0.3);
  --unified-card-title: #253d4e;
  --unified-card-copy: #2b3c46;
  appearance: none;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: start;
  min-width: 0;
  padding: 0 !important;
  overflow: hidden !important;
  color: var(--unified-card-copy) !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  box-shadow: 0 18px 38px rgba(3, 13, 25, 0.34) !important;
  box-sizing: border-box;
}

html body:not(.maintenance-mode) .opportunity-card.artifact-card {
  --unified-card-accent: #526ba8;
  --unified-card-accent-soft: rgba(82, 107, 168, 0.3);
  --unified-card-title: #2d416b;
  --unified-card-copy: #2d3a50;
}

html body:not(.maintenance-mode) .opportunity-card.landmark-card {
  --unified-card-accent: #3f806d;
  --unified-card-accent-soft: rgba(63, 128, 109, 0.3);
  --unified-card-title: #295346;
  --unified-card-copy: #30443d;
}

/* Nine-slice composition keeps the authored corners intact while one frame
   surrounds both the artwork and the description. */
html body:not(.maintenance-mode) .opportunity-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border: 12px solid transparent;
  border-image-source: var(--shared-card-outer-frame);
  border-image-slice: 88 76 88 76;
  border-image-width: 12px 10px;
  border-image-outset: 0;
  border-image-repeat: stretch;
  box-sizing: border-box;
}

html body:not(.maintenance-mode) .opportunity-card::after,
html body:not(.maintenance-mode) .artifact-card::after {
  content: none !important;
  display: none !important;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-art {
  position: relative;
  z-index: 0;
  display: block;
  width: 100% !important;
  max-width: none !important;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    linear-gradient(180deg, transparent 82%, rgba(9, 18, 30, 0.18)),
    var(--opportunity-art, none) center / cover no-repeat,
    #0b1622 !important;
  box-shadow: none !important;
  filter: none;
}

html body:not(.maintenance-mode) .opportunity-card.artifact-card .artifact-art {
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, transparent 82%, rgba(9, 18, 30, 0.16)),
    var(--opportunity-art, none) center / cover no-repeat,
    #0b1622 !important;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy {
  position: relative !important;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-self: stretch;
  align-content: center;
  min-width: 0;
  min-height: 164px;
  width: 100%;
  margin: 0 !important;
  padding: 14px 22px 16px !important;
  gap: 6px !important;
  overflow: hidden;
  color: var(--unified-card-copy) !important;
  border: 14px solid transparent !important;
  border-image-source: var(--shared-card-description-base) !important;
  border-image-slice: 58 76 66 76 fill !important;
  border-image-width: 14px 18px !important;
  border-image-outset: 0 !important;
  border-image-repeat: stretch !important;
  background: rgba(248, 246, 238, 0.98) !important;
  box-shadow: none !important;
  filter: none !important;
  box-sizing: border-box;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > em {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--unified-card-accent) !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 10px !important;
  font-style: normal;
  font-weight: 950 !important;
  line-height: 1 !important;
  letter-spacing: 0.1em !important;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > em::before,
html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > em::after {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--unified-card-accent));
  opacity: 0.72;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > em::after {
  transform: scaleX(-1);
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > strong {
  min-width: 0;
  color: var(--unified-card-title) !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: clamp(17px, 1.62vw, 22px) !important;
  font-weight: 950 !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-copy > small,
html body:not(.maintenance-mode) .artifact-card .artifact-copy > small {
  min-width: 0;
  color: var(--unified-card-copy) !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
  font-size: clamp(12px, 1.04vw, 14px) !important;
  font-weight: 720 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  text-align: left;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

html body:not(.maintenance-mode) .opportunity-card .opportunity-category {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  justify-self: center;
  min-width: 66px !important;
  max-width: calc(100% - 8px) !important;
  min-height: 20px !important;
  margin-top: 2px;
  padding: 3px 9px !important;
  transform: none !important;
  border: 1px solid color-mix(in srgb, var(--opportunity-category-border) 55%, #fff 45%) !important;
  border-radius: 4px !important;
  color: var(--opportunity-category-text) !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  background: color-mix(in srgb, var(--unified-card-accent-soft) 55%, rgba(255, 255, 255, 0.86) 45%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 2px 6px rgba(38, 53, 61, 0.14) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

html body:not(.maintenance-mode) .opportunity-card.interactive:hover,
html body:not(.maintenance-mode) .opportunity-card.interactive:focus-visible,
html body:not(.maintenance-mode) .opportunity-card[data-hover-fx="once"]:hover,
html body:not(.maintenance-mode) .opportunity-card[data-hover-fx="once"]:focus-visible {
  outline: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow:
    0 22px 46px rgba(3, 13, 25, 0.4),
    0 0 24px color-mix(in srgb, var(--unified-card-accent) 24%, transparent) !important;
}

html body:not(.maintenance-mode) .opportunity-card.interactive:hover::before,
html body:not(.maintenance-mode) .opportunity-card.interactive:focus-visible::before,
html body:not(.maintenance-mode) .opportunity-card[data-hover-fx="once"]:hover::before,
html body:not(.maintenance-mode) .opportunity-card[data-hover-fx="once"]:focus-visible::before {
  filter: brightness(1.035) saturate(1.04);
}

html body:not(.maintenance-mode)
  #opportunityLibraryDialog
  .opportunity-library-grid:not(.artifact-library-grid)
  .opportunity-card,
html body:not(.maintenance-mode) #artifactLibraryDialog .artifact-card,
html body:not(.maintenance-mode) #opportunityOptions .opportunity-card,
html body:not(.maintenance-mode) #artifactOptions .artifact-card {
  border: 0 !important;
  background: transparent !important;
}

html body:not(.maintenance-mode) .opportunity-card.artifact-card .opportunity-copy,
html body:not(.maintenance-mode) .opportunity-card.landmark-card .opportunity-copy {
  min-height: 172px;
}

@media (max-width: 720px) {
  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card {
    border-radius: 6px !important;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card::before {
    border-width: 7px;
    border-image-width: 7px 6px;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy {
    grid-template-rows: auto auto 1fr auto;
    align-content: center;
    min-height: 160px;
    width: 100%;
    margin: 0 !important;
    padding: 8px 6px 10px !important;
    gap: 3px !important;
    border-width: 8px !important;
    border-image-source: var(--shared-card-description-base-mobile) !important;
    border-image-slice: 84 54 82 54 fill !important;
    border-image-width: 8px !important;
    background: rgba(248, 246, 238, 0.98) !important;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy > em {
    gap: 3px;
    font-size: 7px !important;
    letter-spacing: 0.05em !important;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy > em::before,
  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy > em::after {
    width: 8px;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy > strong {
    font-size: clamp(11px, 3.05vw, 14px) !important;
    line-height: 1.08 !important;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-copy > small {
    font-size: clamp(8px, 2.3vw, 10px) !important;
    line-height: 1.22 !important;
  }

  html body:not(.maintenance-mode) #opportunityOptions .opportunity-card .opportunity-category {
    min-width: 52px !important;
    min-height: 17px !important;
    margin-top: 1px;
    padding: 2px 5px !important;
    font-size: 8px !important;
  }

  html body:not(.maintenance-mode) #artifactOptions .artifact-card .opportunity-copy {
    align-content: center;
    min-height: 174px;
    width: 100%;
    margin: 0 !important;
    padding: 13px 22px 15px !important;
    gap: 4px !important;
    border-width: 13px !important;
    border-image-source: var(--shared-card-description-base) !important;
    border-image-slice: 58 76 66 76 fill !important;
    border-image-width: 13px 17px !important;
  }

  html body:not(.maintenance-mode) #artifactOptions .artifact-card .opportunity-copy > em {
    font-size: 9px !important;
    letter-spacing: 0.08em !important;
  }

  html body:not(.maintenance-mode) #artifactOptions .artifact-card .opportunity-copy > strong {
    font-size: clamp(16px, 4.5vw, 19px) !important;
    line-height: 1.1 !important;
  }

  html body:not(.maintenance-mode) #artifactOptions .artifact-card .opportunity-copy > small {
    font-size: clamp(11px, 3.2vw, 13px) !important;
    line-height: 1.32 !important;
  }
}
