/*
 * PRANATARA Material Rarity Triad — chat-138.
 * Epic, Mythic, and Relic are distinguished through existing frame hardware,
 * engraved corners, title cartouches, and rarity plaques. This layer is fully
 * static: it creates no moving light, artwork overlay, or additional foil.
 */

:where(
  .holo-card[data-rarity="Epic"],
  .holo-card[data-rarity="Mythic"],
  .holo-card[data-rarity="Relic"]
) > .ornamental-frame-v002.heirloom-cartouche-frame-v001 {
  isolation: isolate;
  contain: layout style paint;
}

/* EPIC — Intaglio Ametis: angular platinum cuts in matte amethyst enamel. */
.holo-card[data-rarity="Epic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 {
  border-color: #bda4d9 !important;
  border-style: solid !important;
  border-width: 1px !important;
  box-shadow:
    inset 0 0 0 1px #382649,
    inset 0 0 0 2px color-mix(in srgb, var(--frame-accent) 34%, #9273b5) !important;
}

.holo-card[data-rarity="Epic"] .heirloom-corner-intaglio {
  stroke: color-mix(in srgb, var(--frame-light) 42%, #c9b4e2) !important;
  stroke-width: .72 !important;
  stroke-dasharray: 2.4 1.15;
  stroke-linecap: square;
}

.holo-card[data-rarity="Epic"] .frame-signature {
  border-inline: 2px solid #8f70ae;
  box-shadow:
    inset 3px 0 0 #c7addf,
    inset -1px 0 0 #3c294d !important;
}

/* MYTHIC — Damask Daulat: sovereign champagne gilding over oxblood relief. */
.holo-card[data-rarity="Mythic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 {
  border-color: #d8ad68 !important;
  border-style: double !important;
  border-width: 3px !important;
  box-shadow:
    inset 0 0 0 1px #5a241b,
    inset 0 0 0 3px color-mix(in srgb, var(--frame-metal) 40%, #a86836) !important;
}

.holo-card[data-rarity="Mythic"] .heirloom-corner-intaglio {
  stroke: color-mix(in srgb, var(--frame-light) 36%, #e0b86f) !important;
  stroke-width: .92 !important;
  stroke-dasharray: none;
  stroke-linecap: round;
}

.holo-card[data-rarity="Mythic"] .frame-signature {
  border-top: 2px double #d5a75f;
  border-bottom-color: #7c3927;
  box-shadow:
    inset 0 2px 0 #efd29c,
    inset 0 -2px 0 #542019 !important;
}

/* RELIC — Segel Kurator Pusaka: archival ivory, antique platinum, and old gold. */
.holo-card[data-rarity="Relic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 {
  border-color: #d8cfb0 !important;
  border-style: ridge !important;
  border-width: 2px !important;
  box-shadow:
    inset 0 0 0 1px #71694f,
    inset 0 0 0 3px #b7b8ad,
    inset 0 0 0 4px color-mix(in srgb, var(--frame-accent) 28%, #465f56) !important;
}

.holo-card[data-rarity="Relic"] .heirloom-corner-intaglio {
  stroke: color-mix(in srgb, var(--frame-light) 48%, #ded7be) !important;
  stroke-width: .82 !important;
  stroke-dasharray: 4.2 .8 .7 .8;
  stroke-linecap: butt;
}

.holo-card[data-rarity="Relic"] .frame-signature {
  border: 3px double #bcb59c;
  border-top-color: #e1dac0;
  box-shadow:
    inset 2px 0 0 #6a785f,
    inset -2px 0 0 #8d7749 !important;
}

/* Static, non-colour signatures remain readable on every presentation surface. */
#grid > .holo-card[data-rarity="Epic"] .kicker > span:last-child::before,
.collectible-card.holo-card[data-rarity="Epic"] .collectible-rarity::before,
.card.holo-card[data-rarity="Epic"] .copy > small::before { content: "◆ "; }

#grid > .holo-card[data-rarity="Mythic"] .kicker > span:last-child::before,
.collectible-card.holo-card[data-rarity="Mythic"] .collectible-rarity::before,
.card.holo-card[data-rarity="Mythic"] .copy > small::before { content: "✺ "; }

#grid > .holo-card[data-rarity="Relic"] .kicker > span:last-child::before,
.collectible-card.holo-card[data-rarity="Relic"] .collectible-rarity::before,
.card.holo-card[data-rarity="Relic"] .copy > small::before { content: "✧ "; }

#grid > .holo-card[data-rarity="Epic"] .kicker > span:last-child,
.collectible-card.holo-card[data-rarity="Epic"] .collectible-rarity,
.card.holo-card[data-rarity="Epic"] .copy > small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 1px solid #987ab9;
  border-inline-start: 3px solid #cbb4e2;
  border-radius: 3px;
  padding: 3px 7px;
  background: #281d32;
  color: #eadff4;
  text-shadow: 0 1px 0 #140d1a;
}

#grid > .holo-card[data-rarity="Mythic"] .kicker > span:last-child,
.collectible-card.holo-card[data-rarity="Mythic"] .collectible-rarity,
.card.holo-card[data-rarity="Mythic"] .copy > small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 2px double #d7aa63;
  border-radius: 999px;
  padding: 3px 8px;
  background: #351a14;
  color: #f2d29d;
  text-shadow: 0 1px 0 #160907;
}

#grid > .holo-card[data-rarity="Relic"] .kicker > span:last-child,
.collectible-card.holo-card[data-rarity="Relic"] .collectible-rarity,
.card.holo-card[data-rarity="Relic"] .copy > small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 3px double #c7c0a8;
  border-radius: 2px;
  padding: 2px 8px;
  background: #24241f;
  color: #eee7ce;
  text-shadow: 0 1px 0 #0f100d;
}

@media (forced-colors: active) {
  :where(
    .holo-card[data-rarity="Epic"],
    .holo-card[data-rarity="Mythic"],
    .holo-card[data-rarity="Relic"]
  ) > .ornamental-frame-v002.heirloom-cartouche-frame-v001,
  :where(
    .holo-card[data-rarity="Epic"],
    .holo-card[data-rarity="Mythic"],
    .holo-card[data-rarity="Relic"]
  ) .frame-signature {
    border-color: Highlight !important;
    box-shadow: none !important;
  }

  .holo-card[data-rarity="Epic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 { border-style: solid !important; border-width: 2px !important; }
  .holo-card[data-rarity="Mythic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 { border-style: double !important; border-width: 4px !important; }
  .holo-card[data-rarity="Relic"] > .ornamental-frame-v002.heirloom-cartouche-frame-v001 { border-style: ridge !important; border-width: 4px !important; }

  .holo-card[data-rarity="Epic"] .heirloom-corner-intaglio,
  .holo-card[data-rarity="Mythic"] .heirloom-corner-intaglio,
  .holo-card[data-rarity="Relic"] .heirloom-corner-intaglio {
    stroke: Highlight !important;
  }

  #grid > .holo-card[data-rarity] .kicker > span:last-child,
  .collectible-card.holo-card[data-rarity] .collectible-rarity,
  .card.holo-card[data-rarity] .copy > small {
    background: Canvas;
    color: CanvasText;
    border-color: Highlight;
    text-shadow: none;
  }
}
