/* Presentation only: game-specific rarity and variant labels, never card artwork. */
/* A separate overlay leaves the underlying scan, drag image and metadata unchanged. */
.reverse-holo-badge {
  position: absolute;
  z-index: 4;
  right: 4%;
  bottom: 3%;
  width: clamp(14px, 20%, 38px);
  aspect-ratio: 1;
  background: url("/assets/reverse-holo-icon.webp") center / contain no-repeat;
  border-radius: 22%;
  box-shadow: 0 1px 5px rgb(0 0 0 / .45);
  pointer-events: none;
}
.slot.drag-source .reverse-holo-badge { visibility: hidden; }

:root {
  --rarity-text-lightness: 82%;
  --rarity-shine-lightness: 94%;
  --rarity-shade-lightness: 68%;
  --rarity-background-lightness: 12%;
  --rarity-border-alpha: .45;
  --rarity-aura-alpha: .18;
}

.rarity-badge-inline, .variant-badge-inline {
  --rarity-hue: 215;
  --rarity-saturation: 75%;
  --rarity-ink: hsl(var(--rarity-hue) var(--rarity-saturation) var(--rarity-text-lightness));
  --rarity-shine: hsl(var(--rarity-hue) var(--rarity-saturation) var(--rarity-shine-lightness));
  --rarity-shade: hsl(var(--rarity-hue) var(--rarity-saturation) var(--rarity-shade-lightness));
  --rarity-paper: hsl(var(--rarity-hue) 28% var(--rarity-background-lightness));
  --rarity-line: hsl(var(--rarity-hue) var(--rarity-saturation) var(--rarity-text-lightness) / var(--rarity-border-alpha));
  --rarity-aura: hsl(var(--rarity-hue) var(--rarity-saturation) var(--rarity-text-lightness) / var(--rarity-aura-alpha));
}
.tooltip-row strong.rarity-badge-inline,
.tooltip-row strong.variant-badge-inline,
.card-variant-readonly strong.rarity-badge-inline,
.card-variant-readonly strong.variant-badge-inline,
.rarity-badge-inline, .variant-badge-inline {
  display: inline-block;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  justify-self: start;
  align-self: start;
  padding: 3px 10px;
  border: 1px solid var(--rarity-line);
  border-radius: 7px;
  background: var(--rarity-paper);
  color: var(--rarity-ink);
  -webkit-text-fill-color: var(--rarity-ink);
  font-size: inherit;
  line-height: 1.45;
  font-weight: 850;
  letter-spacing: .015em;
  text-transform: none;
  overflow-wrap: anywhere;
  box-shadow: none;
  vertical-align: middle;
  transition: transform .12s ease, box-shadow .12s ease;
}

/* -------------------------------------------------------------------------
   Lower Tier Rarities: Clean, intentional, static colors (No animations/shimmer)
   ------------------------------------------------------------------------- */
/* Common: Neutral subtle grey - clearly common */
.rarity-common {
  --rarity-hue: 215;
  --rarity-saturation: 8%;
  --rarity-text-lightness: 70%;
  --rarity-background-lightness: 14%;
  --rarity-line: rgba(156, 163, 175, 0.35);
  --rarity-paper: rgba(156, 163, 175, 0.1);
  --rarity-ink: #cbd5e1;
}
/* Uncommon: Steel sage / soft teal-grey */
.rarity-uncommon {
  --rarity-hue: 162;
  --rarity-saturation: 26%;
  --rarity-text-lightness: 72%;
  --rarity-paper: rgba(94, 134, 120, 0.15);
  --rarity-line: rgba(110, 165, 145, 0.4);
  --rarity-ink: #99c2b4;
}
/* Rare: Cobalt / Muted Classic Blue */
.rarity-rare {
  --rarity-hue: 214;
  --rarity-saturation: 62%;
  --rarity-text-lightness: 76%;
  --rarity-ink: #70a6f2;
}
/* Promo: Distinctive Jade Green */
.rarity-promo {
  --rarity-hue: 144;
  --rarity-saturation: 68%;
  --rarity-text-lightness: 74%;
  --rarity-ink: #4ade80;
}

/* -------------------------------------------------------------------------
   Mid & High Tier Rarity Base Hues
   ------------------------------------------------------------------------- */
.rarity-rare-holo { --rarity-hue: 196; --rarity-saturation: 90%; }
.rarity-double-rare { --rarity-hue: 275; --rarity-saturation: 85%; }
.rarity-illustration-rare { --rarity-hue: 160; --rarity-saturation: 80%; }
.rarity-special-illustration-rare { --rarity-hue: 345; --rarity-saturation: 90%; }
.rarity-ultra-rare { --rarity-hue: 228; --rarity-saturation: 90%; }
.rarity-hyper-rare { --rarity-hue: 48; --rarity-saturation: 95%; }
.rarity-secret-rare { --rarity-hue: 0; --rarity-saturation: 85%; }
.rarity-super-rare { --rarity-hue: 270; --rarity-saturation: 85%; }
.rarity-leader { --rarity-hue: 35; --rarity-saturation: 92%; }
.rarity-treasure-rare, .rarity-special { --rarity-hue: 292; --rarity-saturation: 88%; }
.rarity-mega-attack-rare { --rarity-hue: 25; --rarity-saturation: 95%; }
.rarity-mega-hyper-rare { --rarity-hue: 45; --rarity-saturation: 95%; }
.rarity-ace-spec { --rarity-hue: 332; --rarity-saturation: 95%; }
.rarity-shiny { --rarity-hue: 188; --rarity-saturation: 92%; }
.rarity-shiny-ultra-rare { --rarity-hue: 198; --rarity-saturation: 92%; }
.rarity-radiant-rare { --rarity-hue: 84; --rarity-saturation: 85%; }
.rarity-amazing-rare { --rarity-hue: 295; --rarity-saturation: 88%; }
.rarity-rare-holo-ex { --rarity-hue: 217; --rarity-saturation: 90%; }
.rarity-rare-holo-gx { --rarity-hue: 239; --rarity-saturation: 84%; }
.rarity-rare-holo-lvx { --rarity-hue: 186; --rarity-saturation: 92%; }
.rarity-rare-break { --rarity-hue: 48; --rarity-saturation: 95%; }
.rarity-rare-prime { --rarity-hue: 215; --rarity-saturation: 25%; }
.rarity-legend { --rarity-hue: 38; --rarity-saturation: 92%; }
.rarity-black-white-rare { --rarity-hue: 0; --rarity-saturation: 0%; }
.rarity-futuristic-rare { --rarity-hue: 282; --rarity-saturation: 90%; }
.rarity-pikachu-rare { --rarity-hue: 50; --rarity-saturation: 96%; }
.rarity-classic-collection { --rarity-hue: 40; --rarity-saturation: 100%; }
.rarity-trainer-gallery-rare { --rarity-hue: 173; --rarity-saturation: 82%; }

/* Variants */
.variant-badge-inline { --rarity-hue: 207; --rarity-saturation: 65%; }
.variant-treatment-manga { --rarity-hue: 0; --rarity-saturation: 0%; }
.variant-treatment-sp { --rarity-hue: 280; --rarity-saturation: 90%; }
.variant-treatment-alt_art { --rarity-hue: 171; --rarity-saturation: 75%; }
.variant-treatment-jolly_roger { --rarity-hue: 48; --rarity-saturation: 90%; }
.variant-treatment-holo { --rarity-hue: 196; --rarity-saturation: 85%; }
.variant-treatment-reverse_holo { --rarity-hue: 204; --rarity-saturation: 88%; }
.variant-treatment-stamped { --rarity-hue: 155; --rarity-saturation: 75%; }
.variant-treatment-first_edition, .variant-treatment-shadowless { --rarity-hue: 38; --rarity-saturation: 85%; }
.rarity-badge-inline[hidden], .variant-badge-inline[hidden] { display: none; }

/* -------------------------------------------------------------------------
   Standard Shimmer Sweep for Mid-Tier Treated Badges
   ------------------------------------------------------------------------- */
.tooltip-row strong.rarity-badge-inline.rarity-treatment,
.tooltip-row strong.variant-badge-inline.variant-treatment,
.card-variant-readonly strong.rarity-badge-inline.rarity-treatment,
.card-variant-readonly strong.variant-badge-inline.variant-treatment,
.rarity-badge-inline.rarity-treatment,
.variant-badge-inline.variant-treatment {
  background-image: linear-gradient(110deg, var(--rarity-ink) 0%, var(--rarity-shade) 25%,
    var(--rarity-shine) 50%, var(--rarity-shade) 75%, var(--rarity-ink) 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rarityLabelSweep 3.5s linear infinite;
  box-shadow: 0 0 8px var(--rarity-aura);
}

.tooltip-row strong.rarity-badge-inline.rarity-treatment.rarity-treatment-premium,
.card-variant-readonly strong.rarity-badge-inline.rarity-treatment.rarity-treatment-premium,
.rarity-badge-inline.rarity-treatment-premium {
  animation-duration: 2.8s;
  border-color: var(--rarity-ink);
  text-shadow: 0 0 10px var(--rarity-aura);
  box-shadow: inset 0 0 0 1px var(--rarity-aura), 0 0 12px var(--rarity-aura);
}

/* -------------------------------------------------------------------------
   Special Thematic Text Effects (RGB Rare, Manga, MHR, Classic Collection, SIR, IR, BWR, FR, ACE SPEC)
   ------------------------------------------------------------------------- */

/* 1. Manga (One Piece): Glowing divine pure white text with radiant halo */
.tooltip-row strong.variant-badge-inline.variant-treatment-manga,
.card-variant-readonly strong.variant-badge-inline.variant-treatment-manga,
.variant-badge-inline.variant-treatment-manga {
  background-image: linear-gradient(110deg, #ffffff 0%, #e0f2fe 25%, #ffffff 50%, #bae6fd 75%, #ffffff 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 20px rgba(186, 230, 253, 0.8), 0 0 30px rgba(186, 230, 253, 0.5) !important;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.4), 0 0 14px rgba(255, 255, 255, 0.7) !important;
  animation: rarityLabelSweep 3s linear infinite, mangaGlowPulse 2.4s ease-in-out infinite alternate !important;
}
@keyframes mangaGlowPulse {
  0% { filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.6)); }
  100% { filter: brightness(1.35) drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)); }
}

/* 2. RGB Rare (Pokémon): Dynamic prismatic rainbow spectrum sweep */
.tooltip-row strong.rarity-badge-inline.rarity-rgb-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-rgb-rare,
.rarity-badge-inline.rarity-rgb-rare {
  background-image: linear-gradient(110deg, #ff3b30 0%, #ff9500 14%, #ffd60a 28%, #34c759 42%, #00c7be 56%, #32ade6 70%, #af52de 84%, #ff3b30 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: rgbLabelSweep 3s linear infinite !important;
  border-color: rgba(0, 210, 255, 0.65) !important;
  background-color: rgba(0, 210, 255, 0.08) !important;
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.6), 0 0 18px rgba(255, 0, 200, 0.45) !important;
  box-shadow: inset 0 0 8px rgba(0, 210, 255, 0.3), 0 0 14px rgba(255, 0, 180, 0.45) !important;
}
@keyframes rgbLabelSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* 3. Mega Hyper Rare (Pokémon): 24k Gold text with animated star glitter twinkle */
.tooltip-row strong.rarity-badge-inline.rarity-mega-hyper-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-mega-hyper-rare,
.rarity-badge-inline.rarity-mega-hyper-rare {
  background-image: linear-gradient(110deg, #ca8a04 0%, #fef08a 25%, #ffffff 50%, #eab308 75%, #ca8a04 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #facc15 !important;
  background-color: rgba(250, 204, 21, 0.1) !important;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.9), 0 0 22px rgba(234, 179, 8, 0.6) !important;
  box-shadow: inset 0 0 8px rgba(250, 204, 21, 0.35), 0 0 14px rgba(250, 204, 21, 0.6) !important;
  animation: rarityLabelSweep 2.8s linear infinite, goldTwinkle 1.6s ease-in-out infinite alternate !important;
}
@keyframes goldTwinkle {
  0% { filter: brightness(1) drop-shadow(0 0 3px rgba(250, 204, 21, 0.5)); }
  100% { filter: brightness(1.28) drop-shadow(0 0 9px rgba(254, 240, 138, 0.95)); }
}

/* 4. Classic Collection (Pokémon): Sunburst gold/amber hyper shimmer */
.tooltip-row strong.rarity-badge-inline.rarity-classic-collection,
.card-variant-readonly strong.rarity-badge-inline.rarity-classic-collection,
.rarity-badge-inline.rarity-classic-collection {
  background-image: linear-gradient(110deg, #d97706 0%, #fde68a 25%, #ffffff 50%, #fbbf24 75%, #d97706 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.1) !important;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.85), 0 0 20px rgba(217, 119, 6, 0.6) !important;
  box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.35), 0 0 14px rgba(245, 158, 11, 0.55) !important;
  animation: rarityLabelSweep 2.8s linear infinite !important;
}

/* 5. Special Illustration Rare (Pokémon): Intense ruby/rose radiant crystal glow */
.tooltip-row strong.rarity-badge-inline.rarity-special-illustration-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-special-illustration-rare,
.rarity-badge-inline.rarity-special-illustration-rare {
  background-image: linear-gradient(110deg, #e11d48 0%, #fda4af 25%, #ffffff 50%, #f43f5e 75%, #e11d48 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #fb7185 !important;
  background-color: rgba(225, 29, 72, 0.12) !important;
  text-shadow: 0 0 12px rgba(251, 113, 133, 0.95), 0 0 24px rgba(225, 29, 72, 0.75) !important;
  box-shadow: inset 0 0 8px rgba(251, 113, 133, 0.4), 0 0 16px rgba(225, 29, 72, 0.7) !important;
  animation: rarityLabelSweep 2.6s linear infinite, sirGlowPulse 1.8s ease-in-out infinite alternate !important;
}
@keyframes sirGlowPulse {
  0% { filter: brightness(1) drop-shadow(0 0 4px rgba(244, 63, 94, 0.6)); }
  100% { filter: brightness(1.25) drop-shadow(0 0 12px rgba(251, 113, 133, 0.95)); }
}

/* 6. Illustration Rare (Pokémon): Mint/Emerald crystalline shimmer & gentle radiant aura */
.tooltip-row strong.rarity-badge-inline.rarity-illustration-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-illustration-rare,
.rarity-badge-inline.rarity-illustration-rare {
  background-image: linear-gradient(110deg, #059669 0%, #6ee7b7 25%, #ffffff 50%, #34d399 75%, #059669 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #34d399 !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.75), 0 0 16px rgba(5, 150, 105, 0.45) !important;
  box-shadow: inset 0 0 6px rgba(52, 211, 153, 0.25), 0 0 10px rgba(16, 185, 129, 0.4) !important;
  animation: rarityLabelSweep 3.2s linear infinite, irGlowPulse 2.2s ease-in-out infinite alternate !important;
}
@keyframes irGlowPulse {
  0% { filter: brightness(1) drop-shadow(0 0 3px rgba(52, 211, 153, 0.45)); }
  100% { filter: brightness(1.2) drop-shadow(0 0 8px rgba(110, 231, 183, 0.85)); }
}

/* 7. Black White Rare (Pokémon): High-contrast monochrome split & chrome sweep */
.tooltip-row strong.rarity-badge-inline.rarity-black-white-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-black-white-rare,
.rarity-badge-inline.rarity-black-white-rare {
  background-image: linear-gradient(110deg, #ffffff 0%, #a1a1aa 25%, #18181b 50%, #a1a1aa 75%, #ffffff 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #f4f4f5 !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 16px rgba(0, 0, 0, 0.9) !important;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.35), 0 0 12px rgba(255, 255, 255, 0.5) !important;
  animation: rarityLabelSweep 3.2s linear infinite !important;
}

/* 8. Futuristic Rare (Pokémon): Cyber violet metallic sheen & purple neon glow */
.tooltip-row strong.rarity-badge-inline.rarity-futuristic-rare,
.card-variant-readonly strong.rarity-badge-inline.rarity-futuristic-rare,
.rarity-badge-inline.rarity-futuristic-rare {
  background-image: linear-gradient(110deg, #a855f7 0%, #e9d5ff 25%, #ffffff 50%, #c084fc 75%, #a855f7 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #c084fc !important;
  background-color: rgba(168, 85, 247, 0.1) !important;
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.9), 0 0 22px rgba(147, 51, 234, 0.7) !important;
  box-shadow: inset 0 0 8px rgba(192, 132, 252, 0.35), 0 0 14px rgba(168, 85, 247, 0.6) !important;
  animation: rarityLabelSweep 2.8s linear infinite !important;
}

/* 9. SP Variant (One Piece): Royal Violet & Gold dual foil */
.tooltip-row strong.variant-badge-inline.variant-treatment-sp,
.card-variant-readonly strong.variant-badge-inline.variant-treatment-sp,
.variant-badge-inline.variant-treatment-sp {
  background-image: linear-gradient(110deg, #7e22ce 0%, #38bdf8 25%, #fef08a 50%, #c084fc 75%, #7e22ce 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: #c084fc !important;
  background-color: rgba(126, 34, 206, 0.12) !important;
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.9), 0 0 20px rgba(56, 189, 248, 0.6) !important;
  box-shadow: inset 0 0 8px rgba(192, 132, 252, 0.35), 0 0 14px rgba(192, 132, 252, 0.6) !important;
  animation: rarityLabelSweep 3s linear infinite !important;
}

/* 10. ACE SPEC Rare (Pokémon): Subtle neon magenta pink sweep */
.tooltip-row strong.rarity-badge-inline.rarity-ace-spec,
.card-variant-readonly strong.rarity-badge-inline.rarity-ace-spec,
.rarity-badge-inline.rarity-ace-spec {
  background-image: linear-gradient(110deg, #be185d 0%, #f472b6 25%, #fdf2f8 50%, #db2777 75%, #be185d 100%) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  border-color: rgba(244, 114, 182, 0.55) !important;
  background-color: rgba(219, 39, 119, 0.07) !important;
  text-shadow: 0 0 6px rgba(244, 114, 182, 0.55) !important;
  box-shadow: inset 0 0 4px rgba(244, 114, 182, 0.2), 0 0 8px rgba(219, 39, 119, 0.25) !important;
  animation: rarityLabelSweep 3.6s linear infinite !important;
}

@keyframes rarityLabelSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.rarity-registry-style { --rarity-ink: var(--registry-label-color, var(--text)); --rarity-line: var(--rarity-ink); }
.rarity-registry-style.registry-effect-glow { text-shadow: 0 0 9px var(--rarity-ink); }
.rarity-registry-style.registry-effect-shimmer { animation: registryLabelShimmer 3s ease-in-out infinite; }
#modalRoot .custom-select-search { position: sticky; top: 0; width: 100%; min-height: 40px; background: var(--box, var(--bg)); color: var(--text); }
#modalRoot .custom-select-option[hidden] { display: none; }
@keyframes registryLabelShimmer { 50% { filter: brightness(1.25); text-shadow: 0 0 8px var(--rarity-ink); } }

@media (prefers-reduced-motion: reduce) {
  .rarity-registry-style.registry-effect-shimmer { animation: none; }
  .tooltip-row strong.rarity-badge-inline.rarity-treatment,
  .tooltip-row strong.variant-badge-inline.variant-treatment,
  .card-variant-readonly strong.rarity-badge-inline.rarity-treatment,
  .card-variant-readonly strong.variant-badge-inline.variant-treatment,
  .rarity-badge-inline.rarity-treatment,
  .variant-badge-inline.variant-treatment,
  .rarity-badge-inline.rarity-rgb-rare,
  .rarity-badge-inline.rarity-mega-hyper-rare,
  .rarity-badge-inline.rarity-classic-collection,
  .rarity-badge-inline.rarity-special-illustration-rare,
  .rarity-badge-inline.rarity-illustration-rare,
  .rarity-badge-inline.rarity-black-white-rare,
  .rarity-badge-inline.rarity-futuristic-rare,
  .rarity-badge-inline.rarity-ace-spec,
  .variant-badge-inline.variant-treatment-sp,
  .variant-badge-inline.variant-treatment-manga { animation: none !important; background-position: 45% 50% !important; }
}

/* Tags: unofficial collector names (Gold Rare, Manga Luffy), quieter than the printed rarity above them. */
.tooltip-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
/* Scoped above `.tooltip-row span`, the row-label rule (uppercase, 9px). */
:is(.tooltip-tags, .card-tags) .card-tag {
  font: 600 11px/1.2 var(--sans, inherit); color: var(--muted, #c9c2b4); padding: 2px 8px;
  text-transform: none; letter-spacing: 0;
  border: 2px solid var(--ink, #0d0e14); border-radius: 8px; background: var(--chrome-3, #2a2d3b); white-space: nowrap;
}
.tooltip-tags-row { margin-top: 8px; }
.card-tags .card-tag { font-size: 12px; padding: 4px 10px; }
