/* ============================================================================
   rarity.css - the color of each rarity. Elements get a tint of their color
   everywhere: the sidebar, the canvas, the dictionary's recipes and the account page.
   File: game/static/game/css/rarity.css   (load it AFTER style.css / recipes.css)

   HOW TO EDIT
   1. Change a color in section 1 (the light-mode value, then the dark-mode one).
   2. --rarity-tint  = how strongly an element's background is tinted (0% - 100%).
      --rarity-edge  = how strongly its border is colored.
   3. "Common" elements are left exactly as they were, on purpose.
   4. To add a tier (say "mythic"): add it to TIERS and LABELS in game/rarity.py,
      then copy a block in sections 1-3 below and rename it.
   ============================================================================ */


/* ---------- 1. COLORS ---------- */
:root {
  --rarity-rare:      #29BF12;   /* blue    */
  --rarity-epic:      #8f2bff;   /* purple  */
  --rarity-legendary: #E365C1;   /* red     */

  --rarity-tint: 5%;            /* background tint strength */
  --rarity-edge: 55%;            /* border color strength */
  --rarity-glow: 12px

}

/* dark mode: lighter colors, a slightly stronger tint so it still shows on dark grey */
html[data-theme="dark"] {
  --rarity-rare:      #29BF12;
  --rarity-epic:      #a463ff;
  --rarity-legendary: #E675C8;

  --rarity-tint: 10%;
  --rarity-edge: 65%;
  --rarity-glow: 12px
}


/* ---------- 2. TINTED ELEMENTS (sidebar, canvas, recipes, account) ---------- */
.rarity-rare      { --rarity: var(--rarity-rare); }
.rarity-epic      { --rarity: var(--rarity-epic); }
.rarity-legendary { --rarity: var(--rarity-legendary); }

.rarity-rare,
.rarity-epic,
.rarity-legendary {
  background: color-mix(in srgb, var(--rarity) var(--rarity-tint), var(--pill-bg, var(--recipe-pill-bg, #ffffff)));
  border-color: var(--rarity);                                   /* full-color edge */
  box-shadow:
    inset 0 0 0 1px var(--rarity),                               /* makes the edge 2px thick */
    0 0 var(--rarity-glow) color-mix(in srgb, var(--rarity) 55%, transparent);   /* glow */
}


/* ---------- 3. RARITY TEXT: the little tier name and the filter buttons ---------- */
.tier-rare      { --tier: var(--rarity-rare); }
.tier-epic      { --tier: var(--rarity-epic); }
.tier-legendary { --tier: var(--rarity-legendary); }

.tier-badge {                          /* e.g. "کمیاب" next to an element's name */
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--tier, var(--recipe-muted, #71717a));
  border-radius: 999px;
  color: var(--tier, var(--recipe-muted, #71717a));
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.7;
}
