/* v245: item tiles drawn like the game's own inventory cards: the rarity colour is the card itself.
   Rarity comes from the game's Data.Items (assets/item-rarity.json); hues follow the game's ColorPresets, brightened for the dark site.
   Mythic is the game's rainbow, Secret is red into black. Gems and Summer Pearls have their own card colour. */
[data-rarity] {
  --card-hi: #9aa0b6;
  --card-lo: #3d4256;
  --card-glow: #9aa0b6;
  --card-fill: linear-gradient(165deg, var(--card-hi) 0%, var(--card-lo) 78%);
}
[data-rarity="rare"] { --card-hi: #5cc0ff; --card-lo: #163f96; --card-glow: #3fa8ff; }
[data-rarity="epic"] { --card-hi: #c891ff; --card-lo: #4a1d9c; --card-glow: #b16cff; }
[data-rarity="legendary"] { --card-hi: #ffd864; --card-lo: #b0560c; --card-glow: #ffbf3a; }
[data-rarity="gold"] { --card-hi: #ffe07a; --card-lo: #b3700f; --card-glow: #ffc94a; }
[data-rarity="mythic"] { --card-glow: #ff6ad5; --card-fill: linear-gradient(155deg, #ff7ad9 0%, #b16cff 42%, #3f8dff 100%); }
[data-rarity="secret"] { --card-glow: #ff3344; --card-fill: linear-gradient(165deg, #ff4252 0%, #7a0716 55%, #160006 100%); }
[data-rarity="exclusive"] { --card-glow: #ff3344; --card-fill: linear-gradient(165deg, #ff4252 0%, #7a0716 55%, #160006 100%); }
[data-rarity="gems"] { --card-glow: #2fe0ff; --card-fill: linear-gradient(160deg, #46ecff 0%, #2f7bea 55%, #3a2aa8 100%); }
[data-rarity="pearls"] { --card-glow: #ff8fd6; --card-fill: linear-gradient(160deg, #ffb0e2 0%, #e46fd0 45%, #7b45d6 100%); }

:is(.profile-strip.has-hero .rewards-item, #gains-content .rewards-item, #panel-items .items-card)[data-rarity] {
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--card-fill);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 26%),
    inset 0 1px 0 rgb(255 255 255 / 40%),
    0 6px 16px -8px color-mix(in srgb, var(--card-glow) 75%, transparent);
}
/* Shine like a game card: a soft light on top and fine diagonal lines, under the content. */
:is(.profile-strip.has-hero .rewards-item, #gains-content .rewards-item, #panel-items .items-card)[data-rarity]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% 0%, rgb(255 255 255 / 34%), transparent 70%),
    repeating-linear-gradient(135deg, rgb(255 255 255 / 7%) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 42%));
}
:is(.profile-strip.has-hero .rewards-item, #gains-content .rewards-item, #panel-items .items-card)[data-rarity]:hover {
  border: 0;
  background: var(--card-fill);
  filter: brightness(1.08);
}
:is(.rewards-item, .items-card)[data-rarity] :is(.rewards-item-art, .items-card-art) { background: none; }
:is(.rewards-item, .items-card)[data-rarity] :is(.rewards-item-art, .items-card-art) img {
  filter: drop-shadow(0 0 1px rgb(255 255 255 / 70%)) drop-shadow(0 4px 5px rgb(0 0 0 / 55%));
}
:is(.rewards-item, .items-card)[data-rarity] :is(.rewards-item-name, .items-card-name) {
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgb(0 0 0 / 75%), 0 0 6px rgb(0 0 0 / 35%);
}
.rewards-item[data-rarity] > strong {
  justify-self: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgb(0 0 0 / 50%);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}
.items-card[data-rarity] .items-card-count,
.items-card[data-rarity] .items-card-tier {
  background: rgb(0 0 0 / 58%);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%);
}
@media (prefers-reduced-motion: reduce) { :is(.rewards-item, .items-card)[data-rarity] { transition: none; } }
