/* Printed metal rails and mint marks. Hidden hands and card backs carry no rarity. */
[data-rarity="Common"] {
  --rh-metal: #a6afb3; --rh-light: #edf1ef; --rh-dark: #50595e; --rh-ink: #596167;
  --rh-cut: circle(43%);
  --rh-corner: polygon(0 0,100% 0,89% 17%,17% 17%,17% 89%,0 100%);
  --rh-length: 11%; --rh-weight: 1.5cqw;
}
[data-rarity="Uncommon"] {
  --rh-metal: #54b786; --rh-light: #cef5d6; --rh-dark: #21523e; --rh-ink: #276440;
  --rh-cut: polygon(9% 70%,16% 39%,42% 17%,92% 6%,87% 42%,76% 65%,53% 81%,25% 82%,13% 96%,7% 91%,29% 67%,67% 33%,36% 55%);
  --rh-corner: polygon(0 0,100% 0,75% 17%,46% 21%,25% 40%,18% 70%,0 100%);
  --rh-length: 14%; --rh-weight: 1.8cqw;
}
[data-rarity="Rare"] {
  --rh-metal: #51a8e5; --rh-light: #d0f4ff; --rh-dark: #214e78; --rh-ink: #265b89;
  --rh-cut: polygon(50% 0,99% 50%,50% 100%,1% 50%);
  --rh-corner: polygon(0 0,100% 0,82% 15%,52% 15%,52% 29%,30% 29%,30% 52%,15% 52%,15% 82%,0 100%);
  --rh-length: 16%; --rh-weight: 2.1cqw;
}
[data-rarity="Legendary"] {
  --rh-metal: #e6a643; --rh-light: #fff0b0; --rh-dark: #775029; --rh-ink: #825118;
  --rh-cut: polygon(0 22%,30% 47%,50% 5%,70% 47%,100% 22%,90% 78%,87% 93%,13% 93%,10% 78%);
  --rh-corner: polygon(0 0,100% 0,84% 15%,67% 15%,63% 27%,47% 19%,34% 34%,19% 47%,27% 63%,15% 67%,15% 84%,0 100%);
  --rh-length: 18%; --rh-weight: 2.4cqw;
}
[data-rarity="Mythic"] {
  --rh-metal: #bb77e7; --rh-light: #f7d8ff; --rh-dark: #613a75; --rh-ink: #6c3686;
  --rh-cut: polygon(50% 0,60% 27%,83% 13%,74% 39%,100% 50%,74% 60%,86% 86%,60% 74%,50% 100%,40% 74%,14% 86%,26% 60%,0 50%,26% 40%,14% 14%,40% 27%);
  --rh-corner: polygon(0 0,100% 0,80% 17%,65% 10%,54% 27%,42% 20%,31% 39%,22% 53%,13% 65%,18% 79%,0 100%);
  --rh-length: 20%; --rh-weight: 2.55cqw;
}
.rh-rarity[data-rarity] {
  --edge: var(--rh-metal); --shine: var(--rh-light);
  border: 1px solid var(--rh-dark);
}
.rh-rarity .rh-rarity-frame {
  --rail: clamp(2px, var(--rh-weight), 6px);
  position: absolute; inset: 0; border: 0 solid var(--rh-metal);
  border-width: var(--rail); border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--rh-dark), inset 0 2px 1px var(--rh-light);
}
.rh-rarity .rh-rarity-frame::before, .rh-rarity .rh-rarity-frame::after {
  content: ""; position: absolute; top: 0; width: var(--rh-length); height: auto;
  aspect-ratio: 1; border: 0; border-radius: 0; clip-path: var(--rh-corner);
  background: linear-gradient(140deg, var(--rh-light) 9%, var(--rh-metal) 48%, var(--rh-dark) 92%);
}
.rh-rarity .rh-rarity-frame::before { left: 0; right: auto; }
.rh-rarity .rh-rarity-frame::after { right: 0; left: auto; transform: scaleX(-1); }
.rh-rarity[data-rarity="Rare"] .rh-rarity-frame,
.rh-rarity[data-rarity="Legendary"] .rh-rarity-frame,
.rh-rarity[data-rarity="Mythic"] .rh-rarity-frame {
  box-shadow: inset 0 0 0 1px var(--rh-dark), inset 0 0 0 2px var(--rh-light), inset 0 0 0 3px #28222285;
}
.rh-rarity[data-rarity="Mythic"] .rh-rarity-frame { border-block-color: #e5b1fb; }
.rh-rarity[data-rarity="Mythic"] .rh-rarity-frame::before,
.rh-rarity[data-rarity="Mythic"] .rh-rarity-frame::after { background: linear-gradient(135deg,#ffdf97,var(--rh-metal) 55%,var(--rh-light)); }
.rh-rarity-mark {
  position: absolute; top: calc(0px - var(--rail)); left: 50%; transform: translateX(-50%);
  width: clamp(18px, 28cqw, 59px); height: clamp(9px, 12.5cqw, 27px);
  clip-path: polygon(0 0,100% 0,81% 48%,63% 63%,50% 100%,37% 63%,19% 48%);
  background: linear-gradient(180deg,var(--rh-dark) 10%,#202426 80%,var(--rh-metal) 99%);
}
.rh-rarity-mark::before {
  content: ""; position: absolute; width: 28%; height: 63%; top: 5%; left: 36%;
  clip-path: var(--rh-cut); background: linear-gradient(145deg,white 7%,var(--rh-light) 46%,var(--rh-metal) 98%);
}
.rh-rarity .tc-label small { color: var(--rh-light); }
.cl-unowned .rh-rarity { filter: none; }
.cl-unowned .rh-rarity .tc-art { filter: saturate(.42) brightness(.74); }
.rh-rarity-pip {
  display: inline-block; flex: none; width: .85em; height: .85em;
  clip-path: var(--rh-cut); background: var(--rh-ink); vertical-align: -.035em;
}
.cl-deck-row[data-rarity] { border-inline-start: 3px solid var(--rh-metal); }
.cl-deck-row .rh-rarity-pip { margin-inline-end: .4em; }
.cl-grade .rh-rarity-pip { margin-inline-end: .35em; background: currentColor; }
.rh-rarity-key {
  display: flex; flex-wrap: wrap; gap: 4px 13px; align-items: center;
  margin: 8px 0 12px; padding: 0; list-style: none; color: #554733;
  font: 600 12px/1.35 var(--wr-label, sans-serif);
}
.rh-rarity-key li { display: inline-flex; align-items: center; gap: .32em; }
.cl-mythic-choice[data-rarity] { border-inline-start: 3px solid var(--rh-metal); }
.ll-god[data-rarity] img { border: 2px solid var(--rh-metal); }
@media (forced-colors: active) {
  .rh-rarity .rh-rarity-frame { border-color: CanvasText; }
  .rh-rarity-mark, .rh-rarity-mark::before, .rh-rarity-pip { forced-color-adjust: none; }
  .rh-rarity-mark { background: Canvas; }
  .rh-rarity-mark::before, .rh-rarity-pip { background: CanvasText; }
}

.rh-rarity[data-rarity] .rh-rarity-frame {inset:0; border:0; box-shadow:none; background:none; overflow:hidden}
.rh-rarity[data-rarity] .rh-rarity-frame::before,.rh-rarity[data-rarity] .rh-rarity-frame::after {display:none}
.rh-architecture {position:absolute;display:block;top:0;left:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.cl-top-up-tier img {width:100%;height:clamp(60px,12vh,110px);object-fit:contain;border-radius:4px}
.cl-top-up-tier b{font-size:.92rem;color:#f4ddb0}.cl-top-up-tier small{display:block}
.cl-prefs{display:grid;gap:.6rem}.cl-prefs .cl-select{display:grid;grid-template-columns:1fr 1fr;align-items:center}
.cl-dialog [data-action="switch-profile"]{margin-bottom:12px}
[data-rh-quality="low"] .tc-card,[data-rh-quality="low"] .cl-pack-display{box-shadow:none!important;filter:none!important}
[data-rh-quality="low"] .wf-atmosphere,[data-rh-quality="low"] .dr-particle,[data-rh-quality="balanced"] .dr-pack-light i:nth-of-type(2n){visibility:hidden}
[data-rh-motion="reduced"] *,[data-rh-motion="reduced"] *::before,[data-rh-motion="reduced"] *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
