/*
 * card_rarity.css — CoasterCard Collector
 * Shared rarity treatments for the games (games/*.html) and This or That.
 *
 * 1. Card borders for the rarities each game's own CSS doesn't cover
 *    (Anthracite, Neon, Magma, Ice, Halloween). Every game already styles
 *    Common through Prism on its own card element with a `rarity-<name>`
 *    class; these rules use the same class, so they apply to whichever
 *    element the game puts it on. A game's own, more specific rule always
 *    wins, so nothing it already styles changes.
 *
 * 2. .ccc-rarity-chip — for a card that is shown by NAME ONLY (no art).
 *    Instead of tinting the text (Rare and Prism purples are hard to tell
 *    apart), the name sits in a pill with that rarity's real border: the
 *    Prism rainbow, the Neon cycle, etc. Promotional cards also take their
 *    promo-styles.css class (cardClass) on the chip.
 *      <span class="ccc-rarity-chip" data-rarity="prism">Phoenix</span>
 *
 * Promotional card art: games add the card's `cardClass` (promo-styles.css)
 * next to `rarity-promotional`, so promo cards show their custom border.
 */

/* ── 1. Card borders ─────────────────────────────────────────────────────── */
.rarity-anthracite {
  border-width: 2px; border-style: solid;
  border-color: #1a1a1a;
  animation: ccrAnthracitePulse 2.6s ease-in-out infinite;
}
.rarity-neon {
  border-width: 2px; border-style: solid;
  border-color: #ff2bd6;
  animation: ccrNeonGlow 4.5s linear infinite;
}
.rarity-magma {
  border-width: 2px; border-style: solid;
  border-color: #ff3b1f;
  animation: ccrMagmaGlow 4.5s linear infinite;
}
    .rarity-obsidian {
  border-width: 2px; border-style: solid;
  border-color: #420055;
  animation: ccrObsidianGlow 6s ease-in-out infinite;
}
.rarity-ice {
  border-width: 2px; border-style: solid;
  border-color: #4fd8ff;
  animation: ccrIceGlow 4.5s linear infinite;
}
.rarity-halloween {
  border-width: 2px; border-style: solid;
  border-color: #f78101;
  animation: ccrHalloweenPulse 2.6s ease-in-out infinite;
}

@keyframes ccrAnthracitePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(148,163,184,0.35); border-color: #1a1a1a; }
  50%      { box-shadow: 0 0 14px rgba(226,232,240,0.6);  border-color: #6b7280; }
}
@keyframes ccrNeonGlow {
  0%, 100% { border-color: #ff2bd6; box-shadow: 0 0 12px rgba(255,43,214,0.6); }
  33%      { border-color: #f4ff2b; box-shadow: 0 0 12px rgba(244,255,43,0.6); }
  66%      { border-color: #2bf4ff; box-shadow: 0 0 12px rgba(43,244,255,0.6); }
}
@keyframes ccrMagmaGlow {
  0%, 100% { border-color: #ff3b1f; box-shadow: 0 0 12px rgba(255,59,31,0.6); }
  33%      { border-color: #ff8c00; box-shadow: 0 0 12px rgba(255,140,0,0.6); }
  66%      { border-color: #ffd23b; box-shadow: 0 0 12px rgba(255,210,59,0.6); }
}
    @keyframes ccrObsidianGlow {
  0%, 100% { border-color: #420055; box-shadow: 0 0 12px rgba(66,0,85,0.6); }
  33%      { border-color: #1f0029; box-shadow: 0 0 12px rgba(31,0,41,0.6); }
  66%      { border-color: #000000; box-shadow: 0 0 12px rgba(0,0,0,0.6); }
}
@keyframes ccrIceGlow {
  0%, 100% { border-color: #4fd8ff; box-shadow: 0 0 12px rgba(79,216,255,0.6); }
  33%      { border-color: #ffffff; box-shadow: 0 0 12px rgba(255,255,255,0.55); }
  66%      { border-color: #3b9eff; box-shadow: 0 0 12px rgba(59,158,255,0.6); }
}
@keyframes ccrHalloweenPulse {
  0%, 100% { border-color: #f78101; box-shadow: 0 0 6px rgba(247,129,1,0.5); }
  50%      { border-color: #ffb257; box-shadow: 0 0 14px rgba(247,129,1,0.8); }
}

/* ── 2. Name-only chip ───────────────────────────────────────────────────── */
.ccc-rarity-chip {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 2px 9px; border-radius: 999px;
  border: 2px solid #22c55e;
  background: rgba(255,255,255,0.04);
  color: var(--text, #e5e7eb);
  font-weight: 700; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.ccc-rarity-chip[data-rarity="common"]      { border-color: #22c55e; }
.ccc-rarity-chip[data-rarity="uncommon"]    { border-color: #3b82f6; }
.ccc-rarity-chip[data-rarity="rare"]        { border-color: #a855f7; }
.ccc-rarity-chip[data-rarity="legendary"]   { border-color: #f59e0b; }
.ccc-rarity-chip[data-rarity="exclusive"]   { border-color: #e2e8f0; }
.ccc-rarity-chip[data-rarity="promotional"] { border-color: #ef4444; }
.ccc-rarity-chip[data-rarity="prism"] {
  border-color: transparent;
  background:
    linear-gradient(#1f2a37, #1f2a37) padding-box,
    linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff) border-box;
}
.ccc-rarity-chip[data-rarity="anthracite"] { border-color: #6b7280; animation: ccrAnthracitePulse 2.6s ease-in-out infinite; }
.ccc-rarity-chip[data-rarity="neon"]       { animation: ccrNeonGlow 4.5s linear infinite; }
.ccc-rarity-chip[data-rarity="magma"]      { animation: ccrMagmaGlow 4.5s linear infinite; }
    .ccc-rarity-chip[data-rarity="obsidian"] { animation: ccrObsidianGlow 6s ease-in-out infinite; }
.ccc-rarity-chip[data-rarity="ice"]        { animation: ccrIceGlow 4.5s linear infinite; }
.ccc-rarity-chip[data-rarity="halloween"]  { animation: ccrHalloweenPulse 2.6s ease-in-out infinite; }
/* Promo classes (promo-styles.css) paint a 2px border and big side glows
   sized for full cards; keep the glow small on a chip. */
.ccc-rarity-chip[class*="promo-"] { box-shadow: 0 0 6px rgba(239,68,68,0.35) !important; }

@media (prefers-reduced-motion: reduce) {
  .rarity-anthracite, .rarity-neon, .rarity-magma, .rarity-ice, .rarity-halloween,
  .ccc-rarity-chip { animation: none !important; }
    .rarity-obsidian { animation: none !important; }
}
